What is this?
LLM is a CLI tool and Python library for running prompts against OpenAI, Anthropic Claude, Google Gemini, Qwen, Gemma, Kimi, DeepSeek, Mistral and dozens of other large language models, either via remote APIs or models running locally on your own machine.
Is this a command-line tool or a Python library?
Both: you get an `llm` CLI for running prompts and chats, plus a Python API for prompt execution, embeddings, schemas and conversations from your own code.
How do I install it and start running prompts?
Install with pip, Homebrew, pipx or uv, add an API key if needed (e.g. `llm keys set openai`), then run `llm 'your prompt'` or `llm chat` for an interactive session. Local-model plugins like Ollama can also be installed and used the same way.
Do I need an API key for every model I want to use?
For hosted providers like OpenAI you need an API key (`--key your-api-key` or stored via `llm keys set`), but local models installed through plugins such as Ollama don't require one.
Do I need to install a plugin for every model provider?
Yes — besides built-in OpenAI support, models like Gemini, Claude and local backends each require installing their respective LLM plugin.
Can I use this on macOS, Linux and Windows?
Yes, it's a Python package installable via pip/pipx/uv (or Homebrew on macOS), so it runs cross-platform wherever Python/uv is available.
Where do my prompts and responses get stored?
By default every prompt and response is logged to a local SQLite database on your machine, which you can query, browse with Datasette, or turn off.
Can it work with tools or function calling?
Yes, LLM supports granting models the ability to execute tools, including a set of default tools, and documents how to implement custom ones.
Can I extract structured data instead of plain text?
Yes, LLM supports JSON schemas for extracting structured content from unstructured text or images, with a concise schema syntax and reusable templates.
Can it generate and search embeddings?
Yes, commands like `llm embed`, `llm embed-multi` and `llm similar` let you generate, store and search embeddings, with results stored in collections in SQLite.
Can I use it against any OpenAI-compatible endpoint, like LM Studio?
Yes, you can point LLM at any OpenAI-compatible Chat Completions endpoint (e.g. LM Studio) and run prompts without pre-configuring it, even via `uvx` without installing LLM first.
What are similar projects?
aichat, unsloth, outlines, awesome-llm-apps, kotaemon, LangBot, LongMemory, opensquilla
Which topics is it in?
function-calling, llms, embeddings, json, local-llm, prompt-engineering, ollama, rag, deepseek, sqlite, gemini, claude