LogoAIAny
Icon for item

LLM

LLM is an open-source command-line tool and Python library by Simon Willison for interacting with many large language models (remote APIs like OpenAI, Anthropic, Google Gemini and locally-run models). It supports running prompts and chats from the terminal, extracting text from images, generating and storing embeddings, logging interactions to SQLite, and extensible plugins for additional models and tools.

Introduction

LLM — detailed introduction

LLM is an open-source CLI tool and Python library that makes it easy to interact with large language models from the command line or from Python. Created and maintained by Simon Willison, LLM aims to be a versatile bridge between users and many kinds of models — remote API models (OpenAI, Anthropic, Google Gemini, etc.) and self-hosted models that can be run locally via plugins.

Key features
  • Command-line prompt execution: run single prompts or scripted prompts directly from your shell.
  • Interactive chat: start persistent chat sessions (llm chat) with models and continue conversations.
  • Plugin system: install model plugins (e.g., for Gemini, Anthropic, Ollama) to add new remote or local model backends without modifying core code.
  • Embeddings support: generate, store and query embeddings; includes CLI commands and a Python API for working with embedding collections and similarity search.
  • Attachments and multimodal inputs: pass images (and other attachments) to models and extract structured content such as OCR'd text.
  • Schemas and structured extraction: define JSON-schema-like schemas to extract structured data from unstructured text or images, and log these results for later analysis.
  • Tools and tooling integration: grant models the ability to execute tools and integrate with external workflows.
  • Logging to SQLite: prompts and responses can be logged to a local SQLite database for auditing, browsing and analysis. There are helpers for viewing logs and backing up the database.
Typical usage and workflows
  • Quick one-off prompts from the shell (e.g., llm "Ten fun names for a pet pelican").
  • Start an interactive chat with llm chat -m <model> and continue a session across multiple interactions.
  • Use llm embed and related commands to build an embeddings index and perform similarity queries.
  • Create templates, fragments and schemas to standardize prompt formatting and extraction across projects.
  • Install plugins for access to local models (Ollama, etc.) or additional remote APIs, keeping credentials managed via llm keys.
Extensibility and developer features

LLM exposes a Python API for programmatic prompt execution, async models, tool integration and extensions. Developers can write plugins to register new models, embedding backends, template loaders and custom tools. The project places emphasis on testability (recorded HTTP interactions and snapshot testing), clear documentation and reproducible behavior.

Community and documentation

The project is documented at the official site (listed above), includes an extensive README and docs covering setup, configuration, CLI reference, plugin development, and examples. It is actively used for both experimentation with remote LLM APIs and for integrating self-hosted models into command-line workflows.

Overall, LLM is targeted at developers and power users who want a flexible, scriptable interface to language models, combining local and remote model support, embeddings and structured extraction, and strong plugin-driven extensibility.

Information

  • Websitegithub.com
  • AuthorsSimon Willison
  • Published date2023/04/01

Categories