Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 1.36 KB

File metadata and controls

78 lines (52 loc) · 1.36 KB

Omni CLI

OmniToken ships a small general-purpose CLI under cmd/omni.

Install

go install github.com/ron2111/omnitoken/cmd/omni@latest

Count

omni count -model gpt-4o "hello world"
omni count -encoding o200k_base "hello world"

Encode

omni encode -encoding o200k_base "hello world"

Output:

[24912,2375]

Decode

omni decode -encoding o200k_base "24912 2375"

Cache Planning

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 -breakers

See cacheflow for the JSONL format.

Registry Discovery

List encodings registered in the current CLI build:

omni encodings
omni encodings -json

List exact model mappings:

omni models
omni models -json

Include prefix mappings such as gpt-4o- and fine-tuned model prefixes:

omni models -prefixes

Benchmark Integration

The 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