llm 0.37.3 发布,修复 Homebrew 新版 SQLite 3.54.1 引发的日志问题
llm 0.37.3
如果你用 Homebrew 装 LLM 工具,日志可能悄悄坏了,升级到 0.37.3 就能解决。背后是 SQLite 3.54.1 改了 json_object 的返回行为,作者还附了 workaround 写法。任何在自己项目里用 SQLite JSON 函数的人都值得看一眼这个坑。
Simon Willison 发布了 LLM 命令行工具的 0.37.
3 版本,主要修复 Homebrew 安装包带来的日志代码报错。问题根源在于 Homebrew 现在捆绑的 SQLite 3.
54.1 改变了 json_object 的行为:在 3.
54.0 中,select json_object('a', (select json_array(1))) 返回 {"a":[1]},而 3.
54.1 返回 {"a":"[1]"},子查询结果从 JSON 变成了字符串,导致 LLM 的日志写入失效。
SQLite 作者 D.Richard Hipp 确认这不是回归,而是修正——按文档约定,(SELECT json_array(.
..
)) 返回的是 SQL 文本而非 JSON,3.54.
0 的行为才是 bug。官方推荐的写法是在子查询外包裹 json() 函数:select json_object('a', json((select json_array(1))))。
对通过 Homebrew 使用 LLM 的开发者来说,升级到 0.37.
3 即可恢复正常,这也提醒依赖 SQLite JSON 函数的项目在升级 SQLite 版本时需要留意行为变化。
llm 0.37.3
Release: llm 0.37.3 A bug fix release for LLM , mainly to cover a problem with the most recent Homebrew package of the software. Homebrew now ships the latest SQLite, 3.54.1 , which includes a fix that broke LLM's logging code . Short version: in SQLite 3.54.0 the following SQL: select json_object('a', (select json_array(1))) Returns this: {"a":[1]} But in 3.54.1 the same query returns this: {"a":"[1]"} According to D. Richard Hipp : That was a bug fix. Per the documentation, (SELECT json_array(...)) returns SQL text, not JSON. Hence the 3.54.1 behavior is correct and 3.54.0 was a bug. The workaround looks like this: select json_object('a', json((select json_array(1)))) Tags: llm , webassembly , sqlite , generative-ai , ai , llms , d-richard-hipp
This report is categorized under AITOP's "Products" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include LLM, SQLite, Homebrew, Simon Willison.
Source attribution: curated from Simon Willison’s Weblog.