What is llm?
llm is Simon Willison’s command-line client and Python library for large language models. It logs every prompt and response to SQLite, supports plugins, and can register any OpenAI-compatible model through a YAML file — which is exactly how Tokonomix plugs in.
- Runs prompts from the shell and pipes stdin through a model.
- Registers extra OpenAI-compatible models in
extra-openai-models.yaml(model_id,model_name,api_base,api_key_name). - Supports tool calling via the
supports_toolsflag on a model entry. - Open source; keys are stored with
llm keys set, not in the YAML.
Why route llm through Tokonomix?
- One Tokonomix key in
extra-openai-models.yamlreaches 130+ models without juggling per-provider keys. - Point a
model_idattokonomix-consensusso hard queries get a multi-model verdict; use a direct slug for routine one-liners. - Per-call spend caps bound usage, and region / origin routing keeps sensitive prompts compliant.
- Every call is metered to the cent in your Tokonomix dashboard.
Connect Tokonomix in extra-openai-models.yaml
Add a Tokonomix model entry to extra-openai-models.yaml, then store the key with llm keys set.
# ~/.config/io.datasette.llm/extra-openai-models.yaml
- model_id: anthropic/claude-sonnet-4-6
model_name: anthropic/claude-sonnet-4-6
api_base: "https://tokonomix.ai/api/v1"
api_key_name: tokonomix
supports_tools: true
# Opt-in (planning/review only, no tool-calling): add a second entry with model_id/model_name: tokonomix-consensus
# then: llm keys set tokonomix (paste tok-your-key)
# llm -m anthropic/claude-sonnet-4-6 "Explain quorum sensing"Verify it works
- Add the model entry and run
llm keys set tokonomixto store your key. - Send a small prompt:
llm -m tokonomix-consensus "Explain quorum sensing". - Confirm the call and token usage in your Tokonomix dashboard.