llm 0.33 发布
英文标题:llm 0.33
llm 0.33 将 OpenAI Python 库升级至 3.x,并把 HTTP 客户端依赖从 `httpx` 切换为 `httpx2`,以提供更完整的兼容性修复。`llm embed`、`llm embed-multi` 及相关 Python 嵌入方法现在支持通过 `--key` 或 `key=` 为单次调用传入密钥,同时保持对现有插件的兼容。此次更新还允许重复使用 `llm prompt -t/--template` 按顺序组合多个模板,方便将模型及默认选项封装为可复用配置,并与其他提示模板组合执行。
打开原文相关 3.6 · 机会 0
中文
本次发布中,我最关注的更新:
昨天我已经为此发布了快速的 0.32.1 修复,但这次是更全面的修复。
llm embed和llm embed-multi现在接受--key参数。Python 中的EmbeddingModel.embed()、EmbeddingModel.embed_multi()、Collection.embed()和Collection.embed_multi()方法也接受key=,可将每次调用解析出的密钥传递给嵌入插件,同时不改变共享的模型状态。现有读取self.key的插件仍可通过兼容性回退机制继续工作。感谢 ChrisJr404。#757、#1620
嵌入模型现在采用了与常规 LLM 模型相同的密钥处理模式。
llm prompt -t/--template现在可以重复使用,以按顺序组合模板。这使得一个模板中的模型配置和选项可以与另一个模板中的提示词结合使用。
这解锁了一种很实用的模式:你可以创建模板,将模型及一组默认选项打包在一起:
llm -m gpt-5.6-luna -o reasoning_effort high --save lhigh
llm "Generate an SVG of a pelican riding a bicycle" --save pelican
# 组合并运行这些模板
llm -t lhigh -t pelican
这对于试用不同模型尤其有用,因为这些模型提供了各自对 OpenAI Responses API 的仿真实现。
English / 原文
My highlights from this release:
I shipped a quick 0.32.1 fix for this yesterday, but this is the more comprehensive fix.
llm embedandllm embed-multinow accept--key. The PythonEmbeddingModel.embed(),EmbeddingModel.embed_multi(),Collection.embed()andCollection.embed_multi()methods acceptkey=too, passing the resolved per-call key to embedding plugins without changing shared model state. Existing plugins that readself.keycontinue to work through a compatibility fallback. Thanks, ChrisJr404. #757, #1620
The embedding models now use the same pattern for keys that regular LLM models do.
llm prompt -t/--templatecan now be repeated to combine templates in order. This allows model configuration and options from one template to be used with a prompt from another.
This unlocks a neat pattern where you can create templates that package a model with a set of default options:
llm -m gpt-5.6-luna -o reasoning_effort high --save lhigh
llm "Generate an SVG of a pelican riding a bicycle" --save pelican
# Combine and run the templates
llm -t lhigh -t pelican
This is particularly useful for exercising different models that provide their own imitation of the OpenAI Responses API.