OmniToken ships a small general-purpose CLI under cmd/omni.
go install github.com/ron2111/omnitoken/cmd/omni@latestomni count -model gpt-4o "hello world"
omni count -encoding o200k_base "hello world"omni encode -encoding o200k_base "hello world"Output:
[24912,2375]omni decode -encoding o200k_base "24912 2375"omni cache -model gpt-4o -profile openai "hello world"Analyze a JSONL trace for stable token prefixes and cache-breaker hints:
omni cache-sim -model gpt-4o -profile openai -input prompts.jsonl -breakersSee cacheflow for the JSONL format.
List encodings registered in the current CLI build:
omni encodings
omni encodings -jsonList exact model mappings:
omni models
omni models -jsonInclude prefix mappings such as gpt-4o- and fine-tuned model prefixes:
omni models -prefixesThe bench subcommand runs timing loops inside the Go process and writes Systemcluster-style timing files.
omni bench -name "omnitoken - cl100k - small" -model cl100k_base -input data.txt -timings timings -iters 100 -warmup 10 -batch 10