LLM is an open-source project and welcomes contributions of all kinds — bug fixes, new features, documentation improvements, and plugin development. This guide walks you through setting up a local development environment, running the test suite, updating recorded API interactions, and shipping a new release.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/simonw/LLM/llms.txt
Use this file to discover all available pages before exploring further.
Development Environment
Run tests (uv installs dependencies automatically)
LLM uses You can also invoke your development copy of
uv for dependency management. On the first run, uv automatically creates a virtual environment and installs all required packages, including development dependencies. Just run:llm directly via uv run:Running Tests
Run the full test suite with:Updating Recorded HTTP API Interactions
LLM uses pytest-recording (built on VCR.py) to record real OpenAI API responses and replay them in tests, and syrupy to capture snapshots of the results. When you add a new test that calls the OpenAI API, capture the API response and its snapshot in one step:- New VCR cassette files will be written under
tests/cassettes/. - New snapshot files will be written under
tests/__snapshots__/.
Debugging Tricks
LLM_OPENAI_SHOW_RESPONSES — Inspect raw API traffic
LLM_OPENAI_SHOW_RESPONSES — Inspect raw API traffic
The default OpenAI plugin can log the exact HTTP requests and responses it sends and receives. Enable it with:To see a cleaner, non-streamed version of the response body:
LLM_RAISE_ERRORS — Drop into a debugger on errors
LLM_RAISE_ERRORS — Drop into a debugger on errors
By default LLM suppresses errors during prompt execution. Set If an error occurs, Python drops you into an interactive session. From there you can post-mortem debug:
LLM_RAISE_ERRORS=1 to have them propagate as Python exceptions instead:--pdb — pytest post-mortem debugging
--pdb — pytest post-mortem debugging
When running tests, add
--pdb to drop into the debugger at the point of any failure:Documentation
LLM’s documentation uses MyST — written in Markdown and rendered with Sphinx.Building docs locally
.md files are reflected in the browser automatically.
You need Just installed to run
just commands. Install it with brew install just on macOS or see the Just installation guide for other platforms.Updating CLI help output in the docs
The--help examples in the documentation are auto-generated using Cog. After changing any CLI flags or help text, regenerate the docs:
Release Process
Regenerate cog output
Run
just cog to update docs/fragments.md and any other cog-managed files with the new version number:Create a GitHub Release
Create a new GitHub release tagged with the new version number. The release notes should mirror the changelog entry.
Wait for PyPI
GitHub Actions will automatically publish the package to PyPI when the release is created. Wait for that workflow to complete.
Update the Homebrew tap
Run the regenerate.yaml workflow in the
simonw/homebrew-llm repository to update the Homebrew tap formula to the new version.