Releases: simonw/llm
0.27.1
llm chat -t templatenow correctly loads any tools that are included in that template. #1239- Fixed a bug where
llm -m gpt5 -o reasoning_effort minimal --save gmsaved a template containing invalid YAML. #1237 - Fixed a bug where running
llm chat -t templatecould cause prompts to be duplicated. #1240 - Less confusing error message if a requested toolbox class is unavailable. #1238
0.27
This release adds support for the new GPT-5 family of models from OpenAI. It also enhances tool calling in a number of ways, including allowing templates to bundle pre-configured tools.
New features
- New models:
gpt-5,gpt-5-miniandgpt-5-nano. #1229 - LLM templates can now include a list of tools. These can be named tools from plugins or arbitrary Python function blocks, see Tools in templates. #1009
- Tools can now return attachments, for models that support features such as image input. #1014
- New methods on the
Toolboxclass:.add_tool(),.prepare()and.prepare_async(), described in Dynamic toolboxes. #1111 - New
model.conversation(before_call=x, after_call=y)attributes for registering callback functions to run before and after tool calls. See tool debugging hooks for details. #1088 - Some model providers can serve different models from the same configured URL - llm-llama-server for example. Plugins for these providers can now record the resolved model ID of the model that was used to the LLM logs using the
response.set_resolved_model(model_id)method. #1117 - Raising
llm.CancelToolCallnow only cancels the current tool call, passing an error back to the model and allowing it to continue. #1148 - New
-l/--latestoption forllm logs -q searchtermfor searching logs ordered by date (most recent first) instead of the default relevance search. #1177
Bug fixes and documentation
- The
register_embedding_modelshook is now documented. #1049 - Show visible stack trace for
llm templates show invalid-template-name. #1053 - Handle invalid tool names more gracefully in
llm chat. #1104 - Add a Tool plugins section to the plugin directory. #1110
- Error on
register(Klass)if the passed class is not a subclass ofToolbox. #1114 - Add
-hfor--helpfor allllmCLI commands. #1134 - Add missing
dataclassesto advanced model plugins docs. #1137 - Fixed a bug where
llm logs -T llm_version "version" --asyncincorrectly recorded just one single log entry when it should have recorded two. #1150 - All extra OpenAI model keys in
extra-openai-models.yamlare now documented. #1228
0.26
Tool support is finally here! This release adds support exposing tools to LLMs, previously described in the release notes for 0.26a0 and 0.26a1.
Read Large Language Models can run tools in your terminal with LLM 0.26 for a detailed overview of the new features.
Also in this release:
- Two new default tools:
llm_version()andllm_time(). #1096, #1103 - Documentation on how to add tool supports to a model plugin. #1000
- Added a prominent warning about the risk of prompt injection when using tools. #1097
- Switched to using monotonic ULIDs for the response IDs in the logs, fixing some intermittent test failures. #1099
- New
tool_instancestable records details of Toolbox instances created while executing a prompt. #1089 llm.get_key()is now a documented utility function. #1094
0.26a1
Hopefully the last alpha before a stable release that includes tool support.
Features
- Plugin-provided tools can now be grouped into "Toolboxes".
- Tool support for
llm chat. - Tools can now execute asynchronously.
- Models that implement
AsyncModelcan now run tools, including tool functions defined asasync def. This enables non-blocking tool calls for potentially long-running operations. (#1063)
- Models that implement
llm chatnow supports adding fragments during a session.- Use the new
!fragment <id>command while chatting to insert content from a fragment. Initial fragments can also be passed tollm chatusing-for--sf. Thanks, Dan Turkel. (#1044, #1048)
- Use the new
- Filter
llm logsby tools. llm schemas listcan output JSON.- Added
--jsonand--nl(newline-delimited JSON) options tollm schemas listfor programmatic access to saved schema definitions. (#1070)
- Added
- Filter
llm similarresults by ID prefix.- The new
--prefixoption forllm similarallows searching for similar items only within IDs that start with a specified string (e.g.,llm similar my-collection --prefix 'docs/'). Thanks, Dan Turkel. (#1052)
- The new
- Control chained tool execution limit.
- New
--chain-limit <N>(or--cl) option forllm promptandllm chatto specify the maximum number of consecutive tool calls allowed for a single prompt. Defaults to 5; set to 0 for unlimited. (#1025)
- New
llm plugins --hook <NAME>option.- Filter the list of installed plugins to only show those that implement a specific plugin hook. (#1047)
llm tools listnow shows toolboxes and their methods. (#1013)llm promptandllm chatnow automatically re-enable plugin-provided tools when continuing a conversation (-cor--cid). (#1020)- The
--tools-debugoption now pretty-prints JSON tool results for improved readability. (#1083) - New
LLM_TOOLS_DEBUGenvironment variable to permanently enable--tools-debug. (#1045) llm chatsessions now correctly respect default model options configured withllm models set-options. Thanks, André Arko. (#985)- New
--preoption forllm installto allow installing pre-release packages. (#1060) - OpenAI models (
gpt-4o,gpt-4o-mini) now explicitly declare support for tools and vision. (#1037) - The
supports_toolsparameter is now supported inextra-openai-models.yaml. Thanks, Mahesh Hegde . (#1068)
0.26a0
This is the first alpha to introduce support for tools! Models with tool capability (which includes the default OpenAI model family) can now be granted access to execute Python functions as part of responding to a prompt.
Tools are supported by the command-line interface:
llm --functions '
def multiply(x: int, y: int) -> int:
"""Multiply two numbers."""
return x * y
' 'what is 34234 * 213345'And in the Python API, using a new model.chain() method for executing multiple prompts in a sequence:
import llm
def multiply(x: int, y: int) -> int:
"""Multiply two numbers."""
return x * y
model = llm.get_model("gpt-4.1-mini")
response = model.chain(
"What is 34234 * 213345?",
tools=[multiply]
)
print(response.text())New tools can also be defined using the register_tools() plugin hook. They can then be called by name from the command-line like this:
llm -T multiply 'What is 34234 * 213345?'Tool support is currently under active development. Consult this milestone for the latest status.
0.25
- New plugin feature: register_fragment_loaders(register) plugins can now return a mixture of fragments and attachments. The llm-video-frames plugin is the first to take advantage of this mechanism. #972
- New OpenAI models:
gpt-4.1,gpt-4.1-mini,gpt-41-nano,o3,o4-mini. #945, #965, #976. - New environment variables:
LLM_MODELandLLM_EMBEDDING_MODELfor setting the model to use without needing to specify-m model_idevery time. #932 - New command:
llm fragments loaders, to list all currently available fragment loader prefixes provided by plugins. #941 llm fragmentscommand now shows fragments ordered by the date they were first used. #973llm chatnow includes a!editcommand for editing a prompt using your default terminal text editor. Thanks, Benedikt Willi. #969- Allow
-tand--systemto be used at the same time. #916 - Fixed a bug where accessing a model via its alias would fail to respect any default options set for that model. #968
- Improved documentation for extra-openai-models.yaml. Thanks, Rahim Nathwani and Dan Guido. #950, #957
llm -c/--continuenow works correctly with the-d/--databaseoption.llm chatnow accepts that-d/--databaseoption. Thanks, Sukhbinder Singh. #933
0.25a0
llm models --optionsnow shows keys and environment variables for models that use API keys. Thanks, Steve Morin. #903- Added
py.typedmarker file so LLM can now be used as a dependency in projects that usemypywithout a warning. #887 $characters can now be used in templates by escaping them as$$. Thanks, @guspix. #904- LLM now uses
pyproject.tomlinstead ofsetup.py. #908
0.24.2
0.24.1
0.24
Support for fragments to help assemble prompts for long context models. Improved support for templates to support attachments and fragments. New plugin hooks for providing custom loaders for both templates and fragments. See Long context support in LLM 0.24 using fragments and template plugins for more on this release.
The new llm-docs plugin demonstrates these new features. Install it like this:
llm install llm-docsNow you can ask questions of the LLM documentation like this:
llm -f docs: 'How do I save a new template?'The docs: prefix is registered by the plugin. The plugin fetches the LLM documentation for your installed version (from the docs-for-llms repository) and uses that as a prompt fragment to help answer your question.
Two more new plugins are llm-templates-github and llm-templates-fabric.
llm-templates-github lets you share and use templates on GitHub. You can run my Pelican riding a bicycle benchmark against a model like this:
llm install llm-templates-github
llm -t gh:simonw/pelican-svg -m o3-miniThis executes this pelican-svg.yaml template stored in my simonw/llm-templates repository, using a new repository naming convention.
To share your own templates, create a repository on GitHub under your user account called llm-templates and start saving .yaml files to it.
llm-templates-fabric provides a similar mechanism for loading templates from Daniel Miessler's fabric collection:
llm install llm-templates-fabric
curl https://simonwillison.net/2025/Apr/6/only-miffy/ | \
llm -t f:extract_main_ideaMajor new features:
- New fragments feature. Fragments can be used to assemble long prompts from multiple existing pieces - URLs, file paths or previously used fragments. These will be stored de-duplicated in the database avoiding wasting space storing multiple long context pieces. Example usage:
llm -f https://llm.datasette.io/robots.txt 'explain this file'. #617 - The
llm logsfile now accepts-ffragment references too, and will show just logged prompts that used those fragments. - register_template_loaders() plugin hook allowing plugins to register new
prefix:valuecustom template loaders. #809 - register_fragment_loaders() plugin hook allowing plugins to register new
prefix:valuecustom fragment loaders. #886 - llm fragments family of commands for browsing fragments that have been previously logged to the database.
- The new llm-openai plugin provides support for o1-pro (which is not supported by the OpenAI mechanism used by LLM core). Future OpenAI features will migrate to this plugin instead of LLM core itself.
Improvements to templates:
llm -t $URLoption can now take a URL to a YAML template. #856- Templates can now store default model options. #845
- Executing a template that does not use the
$inputvariable no longer blocks LLM waiting for input, so prompt templates can now be used to try different models usingllm -t pelican-svg -m model_id. #835 llm templatescommand no longer crashes if one of the listed template files contains invalid YAML. #880- Attachments can now be stored in templates. #826
Other changes:
- New llm models options family of commands for setting default options for particular models. #829
llm logs list,llm schemas listandllm schemas showall now take a-d/--databaseoption with an optional path to a SQLite database. They used to take-p/--pathbut that was inconsistent with other commands.-p/--pathstill works but is excluded from--helpand will be removed in a future LLM release. #857llm logs -e/--expandoption for expanding fragments. #881llm prompt -d path-to-sqlite.dboption can now be used to write logs to a custom SQLite database. #858llm similar -p/--plainoption providing more human-readable output than the default JSON. #853llm logs -s/--shortnow truncates to include the end of the prompt too. Thanks, Sukhbinder Singh. #759- Set the
LLM_RAISE_ERRORS=1environment variable to raise errors during prompts rather than suppressing them, which means you can runpython -i -m llm 'prompt'and then drop into a debugger on errors withimport pdb; pdb.pm(). #817 - Improved --help output for
llm embed-multi. #824 llm models -m Xoption which can be passed multiple times with model IDs to see the details of just those models. #825- OpenAI models now accept PDF attachments. #834
llm prompt -q gpt -q 4ooption - pass-q searchtermone or more times to execute a prompt against the first model that matches all of those strings - useful for if you can't remember the full model ID. #841- OpenAI compatible models configured using
extra-openai-models.yamlnow supportsupports_schema: true,vision: trueandaudio: trueoptions. Thanks @adaitche and @giuli007. #819, #843