LLM is a command-line tool and Python library for interacting with large language models, both through remote APIs (OpenAI, Anthropic's Claude, Google's Gemini, Mistral, DeepSeek, and others) and with models that run on your own machine (Qwen, Gemma, Kimi, and more via plugins or any OpenAI-compatible endpoint). You run prompts from the shell, pipe files into them, attach images, audio, or video, and every prompt and response is logged to a SQLite database.
Providers and local runtimes are added through a plugin system: llm keys set stores API keys, -m selects a model, and llm openai endpoint targets any OpenAI-compatible server such as a local Ollama or LM Studio instance without prior configuration. llm chat opens an interactive session with commands for multi-line input, editor editing, and inserting fragments.
Beyond prompting, the tool grants models the ability to call tools (built-in defaults, Python functions, or plugin-provided tools), extracts structured data from text and images against JSON schemas or a concise schema syntax, saves reusable prompt templates as YAML, and manages long-context fragments with aliases. An embeddings subsystem generates and stores vectors in SQLite collections and queries them for similar items, and the Python API exposes the same models, tools, schemas, and embeddings to your own code.
Features
- Prompt execution: run prompts from the shell with system prompts, model options, and piped input
- Attachments: pass images, audio, and video to multimodal models
- SQLite logging: every prompt and response stored locally, browsable and searchable
- Tools: models can execute default tools, Python functions, or plugin tools
- Schemas: structured extraction with JSON schemas or the concise schema syntax, saved in templates and logged as JSON
- Templates: reusable YAML prompts with system prompts, fragments, options, tools, schemas, and default models
- Fragments: long-context pieces referenced by alias or loaded from plugins
- Interactive chat: llm chat with multi-line input, editor editing, and fragment insertion
- Model coverage: OpenAI built in; Gemini, Anthropic, Ollama, and dozens more via plugins; any OpenAI-compatible endpoint via llm openai endpoint
- Embeddings: llm embed, embed-multi, and similar over SQLite-backed collections, plus a Python API and embedding-model plugins
- Aliases and defaults: model aliases, a configurable default model, and per-model default options
- Python library: the same prompting, conversations, tools, schemas, and embeddings from code
