Download bin/cli/tui-components/TokenCounter.jsx from rais133/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/spaces/rais133/omniroute/resolve/main/bin/cli/tui-components/TokenCounter.jsx
- Command line
-
hf download hf://spaces/rais133/omniroute/bin/cli/tui-components/TokenCounter.jsx
-
curl -L -o TokenCounter.jsx https://huggingface.co/spaces/rais133/omniroute/resolve/main/bin/cli/tui-components/TokenCounter.jsx
541 Bytes
| import React from "react"; | |
| import { Box, Text } from "ink"; | |
| export function TokenCounter({ tokensIn = 0, tokensOut = 0, costUsd = 0, model }) { | |
| return ( | |
| <Box flexDirection="column"> | |
| <Box> | |
| <Text bold>In: </Text> | |
| <Text>{tokensIn.toLocaleString()}</Text> | |
| <Text bold> Out: </Text> | |
| <Text>{tokensOut.toLocaleString()}</Text> | |
| <Text bold> Cost: </Text> | |
| <Text color="yellow">${costUsd.toFixed(4)}</Text> | |
| </Box> | |
| {model && <Text dimColor>Model: {model}</Text>} | |
| </Box> | |
| ); | |
| } | |