datasette-llm是 Datasette 的中间插件,支持配置 LLM 以供其他 Datasette 插件使用。

此版本增加了对 OpenAI 兼容端点的支持,因此你可以配置 Datasette 使用托管在任何支持 OpenAI 伪标准 Web 协议的地方的 LLM。

这意味着,如果你正在本地运行模型,使用LM Studio或Ollama或llama.cpp(刚刚发布了v1.0.0),你可以通过如下方式运行 Datasetteuvx像这样:

wget https://datasette.io/content.db

uvx --with datasette-agent datasette \
  --root --secret 1 \
  -s plugins.datasette-llm.default_model '{
"model": "lmstudio-qwen",
"model_name": "qwen/qwen3.8-27b",
"api_base": "http://localhost:1234/v1"
}' content.db

你就会得到一个本地服务器,运行着由你的本地模型驱动的 Datasette Agent 实例!

Screenshot of a chat interface. Header bar reads "home" on the left and "root" with a hamburger menu icon on the right. Below is a back arrow, the heading "Chat", a model label "lmstudio-qwen" and an "EXPORT" button. A blue user message bubble says "how many repos and how many releases are there?" Below it is a collapsed tool call "list_databases_and_tables" and an expanded tool call "sql_query". Its REQUEST section shows database "content", display "both" and the SQL: SELECT (SELECT COUNT(*) FROM repos) AS repo_count, (SELECT COUNT(*) FROM releases) AS release_count. Its RESPONSE section shows columns repo_count and release_count with a single row of 200 and 1889. Below that is a table with columns repo_count and release_count and one row: 200, 1889, followed by a "View SQL query" button. The assistant reply reads "There are 200 repos and 1,889 releases in the content database." At the bottom is a text input with placeholder "Type a message... (# to tag a table or query)" and a blue "Send" button.