CLI Reference
InferShrink includes a command-line interface for testing routing logic, managing indexes, and viewing statistics.
classify
Analyze the complexity of a prompt without running it.
$ infershrink classify "What is 2+2?"
Complexity: SIMPLE (score: 0.12)
Reasoning: Short length, no code blocks, basic arithmetic pattern.
$ infershrink classify "Implement a red-black tree with delete rebalancing"
Complexity: COMPLEX (score: 0.89)
Reasoning: Algorithmic request, requires structural code generation.
route
Simulate how a prompt would be routed given a specific model.
$ infershrink route "Hello world" --model gpt-4o
Original: gpt-4o
Routed: gpt-4o-mini
Action: Downgraded (saved ~95%)
$ infershrink route "Design a distributed consensus algorithm" --model gpt-4o
Original: gpt-4o
Routed: gpt-4o
Action: No change (task too complex)
stats
View global usage statistics and accumulated savings.
$ infershrink stats
Total Requests: 1,402
Routed Down: 982 (70.0%)
Original Cost: $45.20
Actual Cost: $12.40
Total Saved: $32.80 (72.5%)
index
Create a semantic index from a directory of documents.
$ infershrink index ./docs
Indexing 12 files...
Created index at .infershrink/index.faiss (Size: 4.2MB)
clear
Reset local stats and cache.
$ infershrink clear
Stats cleared.