ITADN
simonw/llm

版本发布 8

0.27.1
? · 2025-08-12

- `llm chat -t template` now correctly loads any tools that are included in that template. [#1239](https://github.com/simonw/llm/issues/1239) - Fixed a bug where `llm -m gpt5 -o reasoning_effort minimal --save gm` saved a template containing invalid YAML. [#1237](https://github.com/simonw/llm/issues/1237) - Fixed a bug where running `llm chat -t template` could cause prompts to be duplicated. [#1240](https://github.com/simonw/llm/issues/1240) - Less confusing error message if a requested toolbox class is unavailable. [#1238](https://github.com/simonw/llm/issues/1238)

0.27
? · 2025-08-11

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](https://llm.datasette.io/en/stable/templates.html#prompt-templates) to bundle pre-configured tools. ### New features - New models: `gpt-5`, `gpt-5-mini` and `gpt-5-nano`. [#1229](https://github.com/simonw/llm/issues/1229) - LLM [templates](https://llm.datasette.io/en/stable/templates.html#prompt-templates) can now include a list of tools. These can be named tools from plugins or arbitrary Python function blocks, see [Tools in templates](https://llm.datasette.io/en/stable/templates.html#prompt-templates-tools). [#1009](https://github.com/simonw/llm/issues/1009) - Tools [can now return attachments](https://llm.datasette.io/en/stable/python-api.html#python-api-tools-attachments), for models that support features such as image input. [#1014](https://github.com/simonw/llm/issues/1014) - New methods on the `Toolbox` class: `.add_tool()`, `.prepare()` and `.prepare_async()`, described in [Dynamic toolboxes](https://llm.datasette.io/en/stable/python-api.html#python-api-tools-dynamic). [#1111](https://github.com/simonw/llm/issues/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](https://llm.datasette.io/en/stable/python-api.html#python-api-tools-debug-hooks) for details. [#1088](https://github.com/simonw/llm/issues/1088) - Some model providers can serve different models from the same configured URL - [llm-llama-server](https://github.com/simonw/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](https://github.com/simonw/llm/issues/1117) - Raising `llm.CancelToolCall` now only cancels the current tool call, passing an error back to the model and allowing it to continue. [#1148](https://github.com/simonw/llm/issues/1148) - New `-l/--latest` option for `llm logs -q searchterm` for searching logs ordered by date (most recent first) instead of the default relevance search. [#1177](https://github.com/simonw/llm/issues/1177) ### Bug fixes and documentation - The `register_embedding_models` hook is [now documented](https://llm.datasette.io/en/stable/plugins/plugin-hooks.html#register-embedding-models-register). [#1049](https://github.com/simonw/llm/issues/1049) - Show visible stack trace for `llm templates show invalid-template-name`. [#1053](https://github.com/simonw/llm/issues/1053) - Handle invalid tool names more gracefully in `llm chat`. [#1104](https://github.com/simonw/llm/issues/1104) - Add a [Tool plugins](https://llm.datasette.io/en/stable/plugins/directory.html#plugin-directory-tools) section to the plugin directory. [#1110](https://github.com/simonw/llm/issues/1110) - Error on `register(Klass)` if the passed class is not a subclass of `Toolbox`. [#1114](https://github.com/simonw/llm/issues/1114) - Add `-h` for `--help` for all `llm` CLI commands. [#1134](https://github.com/simonw/llm/issues/1134) - Add missing `dataclasses` to advanced model plugins docs. [#1137](https://github.com/simonw/llm/issues/1137) - Fixed a bug where `llm logs -T llm_version "version" --async` incorrectly recorded just one single log entry when it should have recorded two. [#1150](https://github.com/simonw/llm/issues/1150) - All extra OpenAI model keys in `extra-openai-models.yaml` are [now documented](https://llm.datasette.io/en/stable/other-models.html#openai-compatible-models). [#1228](https://github.com/simonw/llm/issues/1228)

0.26
? · 2025-05-27

**Tool support** is finally here! This release adds support exposing [tools](https://llm.datasette.io/en/stable/tools.html#tools) to LLMs, previously described in the release notes for [0.26a0](https://llm.datasette.io/en/stable/changelog.html#v0-26-a0) and [0.26a1](https://llm.datasette.io/en/stable/changelog.html#v0-26-a1). Read **[Large Language Models can run tools in your terminal with LLM 0.26](https://simonwillison.net/2025/May/27/llm-tools/)** for a detailed overview of the new features. Also in this release: - Two new [default tools](https://llm.datasette.io/en/stable/tools.html#tools-default): `llm_version()` and `llm_time()`. [#1096](https://github.com/simonw/llm/issues/1096), [#1103](https://github.com/simonw/llm/issues/1103) - Documentation on [how to add tool supports to a model plugin](https://llm.datasette.io/en/stable/plugins/advanced-model-plugins.html#advanced-model-plugins-tools). [#1000](https://github.com/simonw/llm/issues/1000) - Added a [prominent warning](https://llm.datasette.io/en/stable/tools.html#tools-warning) about the risk of prompt injection when using tools. [#1097](https://github.com/simonw/llm/issues/1097) - Switched to using monotonic ULIDs for the response IDs in the logs, fixing some intermittent test failures. [#1099](https://github.com/simonw/llm/issues/1099) - New `tool_instances` table records details of Toolbox instances created while executing a prompt. [#1089](https://github.com/simonw/llm/issues/1089) - `llm.get_key()` is now a [documented utility function](https://llm.datasette.io/en/stable/plugins/plugin-utilities.html#plugin-utilities-get-key). [#1094](https://github.com/simonw/llm/issues/1094)

0.26a0预发布
? · 2025-05-14

This is the first alpha to introduce [support for tools](https://llm.datasette.io/en/latest/tools.html#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](https://llm.datasette.io/en/latest/usage.html#usage-tools): ```bash llm --functions ' def multiply(x: int, y: int) -> int: """Multiply two numbers.""" return x * y ' 'what is 34234 * 213345' ``` And in [the Python API](https://llm.datasette.io/en/latest/python-api.html#python-api-tools), using a new `model.chain()` method for executing multiple prompts in a sequence: ```python 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](https://llm.datasette.io/en/latest/plugins/plugin-hooks.html#plugin-hooks-register-tools). They can then be called by name from the command-line like this: ```bash llm -T multiply 'What is 34234 * 213345?' ``` Tool support is currently under **active development**. Consult [this milestone](https://github.com/simonw/llm/milestone/12) for the latest status.

0.25
? · 2025-05-05

- New plugin feature: [register_fragment_loaders(register)](https://llm.datasette.io/en/stable/plugins/plugin-hooks.html#plugin-hooks-register-fragment-loaders) plugins can now return a mixture of fragments and attachments. The [llm-video-frames](https://github.com/simonw/llm-video-frames) plugin is the first to take advantage of this mechanism. [#972](https://github.com/simonw/llm/issues/972) - New OpenAI models: `gpt-4.1`, `gpt-4.1-mini`, `gpt-41-nano`, `o3`, `o4-mini`. [#945](https://github.com/simonw/llm/issues/945), [#965](https://github.com/simonw/llm/issues/965), [#976](https://github.com/simonw/llm/issues/976). - New environment variables: `LLM_MODEL` and `LLM_EMBEDDING_MODEL` for setting the model to use without needing to specify `-m model_id` every time. [#932](https://github.com/simonw/llm/issues/932) - New command: `llm fragments loaders`, to list all currently available fragment loader prefixes provided by plugins. [#941](https://github.com/simonw/llm/issues/941) - `llm fragments` command now shows fragments ordered by the date they were first used. [#973](https://github.com/simonw/llm/issues/973) - `llm chat` now includes a `!edit` command for editing a prompt using your default terminal text editor. Thanks, [Benedikt Willi](https://github.com/Hopiu). [#969](https://github.com/simonw/llm/pull/969) - Allow `-t` and `--system` to be used at the same time. [#916](https://github.com/simonw/llm/issues/916) - Fixed a bug where accessing a model via its alias would fail to respect any default options set for that model. [#968](https://github.com/simonw/llm/issues/968) - Improved documentation for [extra-openai-models.yaml](https://llm.datasette.io/en/stable/other-models.html#openai-compatible-models). Thanks, [Rahim Nathwani](https://github.com/rahimnathwani) and [Dan Guido](https://github.com/dguido). [#950](https://github.com/simonw/llm/pull/950), [#957](https://github.com/simonw/llm/pull/957) - `llm -c/--continue` now works correctly with the `-d/--database` option. `llm chat` now accepts that `-d/--database` option. Thanks, [Sukhbinder Singh](https://github.com/sukhbinder). [#933](https://github.com/simonw/llm/issues/933)

0.25a0预发布
? · 2025-04-11

- `llm models --options` now shows keys and environment variables for models that use API keys. Thanks, [Steve Morin](https://github.com/smorin). [#903](https://github.com/simonw/llm/issues/903) - Added `py.typed` marker file so LLM can now be used as a dependency in projects that use `mypy` without a warning. [#887](https://github.com/simonw/llm/issues/887) - `$` characters can now be used in templates by escaping them as `$$`. Thanks, [@guspix](https://github.com/guspix). [#904](https://github.com/simonw/llm/issues/904) - LLM now uses `pyproject.toml` instead of `setup.py`. [#908](https://github.com/simonw/llm/issues/908)

0.24.2
? · 2025-04-09

- Fixed a bug on Windows with the new `llm -t path/to/file.yaml` feature. [#901](https://github.com/simonw/llm/issues/901)

0.24.1
? · 2025-04-08

- Templates can now be specified as a path to a file on disk, using `llm -t path/to/file.yaml`. This makes them consistent with how `-f` fragments are loaded. [#897](https://github.com/simonw/llm/issues/897) - `llm logs backup /tmp/backup.db` command for [backing up your](https://llm.datasette.io/en/stable/logging.html#backing-up-your-database) `logs.db` database. [#879](https://github.com/simonw/llm/issues/879)