LLM — CLI Tool for 100+ Language Models
LLM is a CLI and Python library for accessing 100+ LLMs via APIs or locally. 11.5K+ stars. SQLite logging, embeddings, structured data. Apache 2.0.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install c9e10dbf-d7ae-4561-995b-198e6d599fe7 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
LLM is a command-line tool and Python library by Simon Willison that provides a unified interface to 100+ language models. It works with both API-based models (OpenAI, Anthropic, Google) and local models (via plugins). Every prompt and response is automatically logged to a SQLite database for later analysis.
Developers, researchers, and power users who work with multiple LLM providers and want a single CLI to query them all will find LLM particularly useful. It eliminates the need to install separate SDKs for each provider.
How it saves time or tokens
LLM's plugin architecture means you install once and add providers as needed. The SQLite logging captures every interaction automatically, so you never lose a useful response. The embeddings subsystem lets you build semantic search over your logged conversations without a separate vector database.
How to use
- Install LLM via pip and configure your API keys for the providers you want to use.
- Run prompts from the command line with
llmor use the Python API in scripts. - Query your conversation history using
llm logsand the built-in SQLite database.
Example
# Install and configure
pip install llm
llm keys set openai
# Simple prompt
llm 'Explain the CAP theorem in three sentences'
# Use a specific model
llm -m claude-3.5-sonnet 'Write a Python decorator for retry logic'
# View conversation logs
llm logs -n 5
# Generate embeddings
llm embed -m ada-002 -c 'vector search query'
Related on TokRepo
- Local LLM tools — Tools for running language models locally including Ollama and LM Studio.
- AI tools for coding — CLI tools and agents for AI-assisted development.
Common pitfalls
- Not installing provider plugins. LLM ships with OpenAI support by default; other providers like Anthropic or local models require separate plugin installation via
llm install llm-anthropic. - Forgetting that logs accumulate. The SQLite database grows with every prompt. Periodically review and clean old logs if disk space is a concern.
- Assuming all models support the same features. Streaming, system prompts, and tool use vary by provider. Check the plugin documentation for model-specific capabilities.
Preguntas frecuentes
LLM supports 100+ models through its plugin system. Built-in support covers OpenAI models. Additional plugins add Anthropic, Google, Mistral, local models via Ollama, and many more.
LLM itself is free and open source under the Apache 2.0 license. You pay only for the API calls to commercial providers like OpenAI or Anthropic. Local models run at no additional cost.
Yes. Through plugins like llm-ollama and llm-gpt4all, LLM can query locally running models. The same CLI interface works regardless of whether the model is remote or local.
Every prompt you send and every response you receive is automatically stored in a local SQLite database. You can query this database with SQL, search your history, and analyze token usage patterns.
Yes. LLM provides a Python API alongside the CLI. You can import it in scripts, use it in notebooks, and integrate it into larger applications while retaining the automatic logging feature.
Referencias (3)
- LLM GitHub— LLM CLI tool by Simon Willison
- LLM Docs— LLM plugin system documentation
- OpenAI API Docs— OpenAI API for language model access
Relacionados en TokRepo
Fuente y agradecimientos
Created by Simon Willison. Apache 2.0. simonw/llm — 11,500+ GitHub stars
Discusión
Activos relacionados
AIChat — All-in-One LLM CLI with 20+ Providers
AIChat is a CLI for 20+ LLM providers with shell assistant, RAG, agents, and function calling. 9.7K+ stars. MIT/Apache 2.0.
sqlite-utils — Python + CLI for ETL Into SQLite
Simon Willison's Python library + CLI for getting messy CSV/JSON/YAML into SQLite. Auto-schema, upserts, joins, FTS indexing one-liners.
files-to-prompt — Concat Files Into LLM-Ready Prompts
Simon Willison's CLI that walks a directory and concats files into one LLM-ready prompt with path markers. Pipes straight into Claude or LLM CLI.
MemPalace — Local-First AI Memory CLI
MemPalace is a local-first memory system with a `mempalace` CLI (+ MCP tools), hitting 96.6% R@5 on LongMemEval with no LLM required.