LLM 新版发布:新增推理轨迹、OpenAI Responses、服务端工具和更智能日志的支持
摘要
LLM 0.32 新增了可见的推理轨迹、服务端工具、新的 GPT-5.6 模型和重新设计的日志记录,并增加了新的 llm openai endpoint 命令,用于连接任何兼容 OpenAI 的端点。
暂无内容
查看缓存全文
缓存时间: 2026/08/05 01:39
# LLM 新版本增加了对推理痕迹、OpenAI Responses、服务端工具和更智能日志的支持
来源:https://simonwillison.net/2026/Aug/4/new-release-of-llm/
2026年8月4日
今天早上我发布了 LLM 0.32(https://llm.datasette.io/en/stable/changelog.html#v0-32),这是自项目最初启动以来最重要的 LLM 新版本。该新版本支持可见的推理痕迹、服务端提供商工具、重新设计的内容寻址 SQLite 日志、新模型,以及由 OpenAI Responses API 启用的新功能。我还发布了新版本的 llm-anthropic 插件(https://github.com/simonw/llm-anthropic),它本身也有大量更新。
#### LLM CLI 用户的核心新功能
现在,在推理模型上运行 LLM 会把它们的推理痕迹输出到标准错误流,这样你可以看到它们在“思考”什么,而这些信息不会包含在你可能通过管道传给其他工具的标准输出中。添加 `-R/--hide-reasoning` 可关闭此功能。
在 macOS 终端窗口中运行 llm "think about the best thing about pelicans" 时,灰色文本输出显示 Exploring pelican qualities,然后在那段文本之后,一段白色文本出现:The best thing about pelicans is their wonderfully oversized, practical design: that enormous bill and pouch look comical, but they make pelicans remarkably skilled fishers. Even better, many species cooperate—working together to herd fish before scooping them up. They’re a great mix of goofy, graceful, and surprisingly clever.
LLM 开箱即用地支持 GPT-5.6 模型家族,并且 `llm "prompt"` 使用的默认模型现在是便宜但功能强大的 GPT-5.6 Luna。
LLM 调用现在可以使用来自不同提供方的服务端工具。OpenAI 提供了一个代码执行环境(https://llm.datasette.io/en/stable/openai-models.html#code-interpreter)作为服务端工具;LLM 现在可以这样运行受益于该工具的提示词:
```
llm --tool CodeInterpreter 'Show current python and SQLite versions'
```
OpenAI 还获得了 WebSearch(https://llm.datasette.io/en/stable/openai-models.html#web-search)工具。
`llm-anthropic`(https://github.com/simonw/llm-anthropic)插件新增了 `WebSearch`(https://github.com/simonw/llm-anthropic/blob/0.26/README.md#web-search)、`WebFetch`(https://github.com/simonw/llm-anthropic/blob/0.26/README.md#web-fetch)、`CodeExecution`(https://github.com/simonw/llm-anthropic/blob/0.26/README.md#code-execution)和 `AnthropicMCP`(https://github.com/simonw/llm-anthropic/blob/0.26/README.md#mcp-connector),像这样:
```
llm -m claude-sonnet-5 -T 'AnthropicMCP("https://datasette.simonwillison.net/-/mcp")' \
'how many rows in the blog_blogmark table?'
```
这会让 Anthropic 在与他们的 API 进行的单次请求/响应交互中,对我的新 datasette-mcp(https://simonwillison.net/2026/Jul/31/stateless-mcp/#datasette-mcp)插件执行 MCP 调用。
新的 **llm openai endpoint** 命令提供了一种工具,可以用单行命令对*任何*兼容 OpenAI 的端点(https://llm.datasette.io/en/stable/other-models.html#run-against-an-endpoint-without-configuring-it)执行提示词。这些调用不会被记录,这使它成为一个方便的工具,可以对任何使用 LLM API 世界通用语言的服务运行一次性提示词。
下面是我如何利用这一点,通过 `uvx`(无需安装 LLM)并额外混入 `llm-tools-quickjs`(https://github.com/simonw/llm-tools-quickjs)工具插件,对运行在本地 LM Studio(https://lmstudio.ai/)API 中的 Gemma 4 12B 运行提示词的方法:
```
uvx --with llm-tools-quickjs \
llm openai endpoint http://localhost:1234/v1 -m google/gemma-4-12b \
-T QuickJS 'Use QuickJS to multiply 3434 * 2434' --td
```
输出内容为 Tool call: QuickJS_execute_javascript({'javascript': '3434 * 2434'}) 8358356 The result of 3434 * 2434 is 8,358,356.
#### Python API 的新功能
LLM 的 Python API 以前要求你先创建一个会话,然后一条一条地向它发送消息。这是对 LLM 真实本质的一种抽象——实际上每个请求都会携带之前所有消息的完整历史。这种抽象在一些更高级的场景中开始变得碍事,因此新版本引入了 `model.prompt(messages=[])` 参数,可以这样使用:
```
import llm
from llm import user, assistant, system
model = llm.get_model("gpt-5.6-luna")
response = model.prompt(messages=[
system("You are a helpful pirate."),
user("What is the capital of France?"),
assistant("Paris, matey."),
user("And Germany?"),
])
print(response.text())
```
LLM 以前会从每个提示词返回一个可迭代的字符串序列。当模型返回字符串响应时,这很有效,但无法预测模型会演变成的奇怪形态。如今许多模型会返回推理文本、输出字符串、工具调用甚至图像附件的混合内容。使用 LLM 0.32,你可以改为这样做(https://llm.datasette.io/en/stable/python-api.html#structured-messages-and-streaming-events):
```
for event in model.prompt("Explain cats").stream_events():
if event.type == "reasoning":
print(f"[thinking] {event.chunk}", end="", flush=True)
elif event.type == "text":
print(event.chunk, end="", flush=True)
else:
print(f"Other event: {event}")
```
把这些功能结合起来,我们*终于*可以为半标准的 OpenAI chat completions API 提供一个稳健的实现。我现在已经把它发布为 `llm-chat-completions-server`(https://github.com/simonw/llm-chat-completions-server)插件:
```
llm install llm-chat-completions-server
llm chat-completions-server --port 9000
# Server is now running on http://127.0.0.1:9000/v1
```
现在,你可以使用新的 `llm openai endpoint` 命令,通过该服务器对 LLM 运行提示词!
```
llm openai endpoint http://127.0.0.1:9000/v1 'hello' -m gpt-5.4-mini
```
这类 API 更大的挑战在于日志。如果我们想支持在每次请求中都追加消息序列的模式,理想情况下应该避免在每一轮都记录所有这些重复的 JSON。
解决方案是新的内容寻址消息存储(https://llm.datasette.io/en/stable/logging.html#the-message-store),其设计模仿了 Git。你可以在文档(https://llm.datasette.io/en/stable/logging.html#sql-schema)中看到它的新 schema,但 `llm logs` 和 `llm logs --json` 命令都已升级,可以将该格式转换回易于使用的内容。
#### 其余更新
这个版本中还有更多内容。0.32 的发布说明(https://llm.datasette.io/en/stable/changelog.html#v0-32)已经相当全面,而 0.32rc2(https
相似文章
llm 0.32a2
llm CLI 工具已发布 0.32a2 版本,新增对 OpenAI /v1/responses 端点的支持,以启用 GPT-5 类模型的交错推理功能。
LLM 0.33
LLM工具0.33版本发布,包括OpenAI依赖项升级、嵌入键支持增强、可重用提示模板,以及Responses API模型的推理摘要选项。
llm 0.32rc2
llm 0.32rc2 修复了一个依赖问题,将 GPT-5.6 Luna 设为默认模型,并新增了一个 'llm openai endpoint' 命令,用于无需配置即可针对兼容 OpenAI 的端点运行提示。
llm 0.32a3
llm 0.32a3版本发布,这是Simon Willison的命令行工具的一个alpha版本,用于与大语言模型交互。
llm 0.31.1
Simon Willison 发布的 llm 0.31.1,这是一个用于与大语言模型交互的命令行工具。