跳到正文
Rohan Paul· @rohanpaul_ai · X·· 3 小时前AI 评分44
AI 导读

TypeLLM 是一个基于 JSON Schema 的类型化 LLM 输出开源项目,可将整个工作流作为依赖图在一次 API 调用中执行。它构建在 SGLang 之上,把 JSON Schema 转为约束解码:enum 或 boolean 只产生一个评分 token,数字限制位数,依赖图复用缓存前缀,因此字段无法返回 enum 之外的值。

正文

Open source meets type-safe AI, with TypeLLM.

Chat models give you a reply and decision models give you a choice, but TypeLLM is built to run your whole workflow in one API call.

Most production pipelines need something in between: several typed answers, some depending on others, a few that should exist only under certain conditions.

TypeLLM takes that whole shape as one JSON Schema and executes it as a dependency graph over a single shared context.

Typed LLM outputs, built in the open.

You can get schema-guaranteed outputs from a stock Qwen checkpoint without touching its weights.

The guarantee comes from how the requests are built and decoded.

TypeLLM sits on SGLang and turns a JSON Schema into constrained decoding: one scored token for an enum or boolean, bounded digits for numbers, and a dependency graph that reuses cached prefixes.

So a field can’t return a value outside its enum, because the decoder only considers the allowed candidates.

https://x.com/TypeLLM/status/2110281195380736292/video/1

引用TypeLLM@TypeLLM
Chat models return messages. Decision models return decisions. Workflow models execute workflows. TypeLLM introduces the first workflow model. Run an entire workflow in a single API call. Simpler, faster, cheaper. Try it now: https://typellm.ai/examples/ticket-workflow
在 X 查看被引用的帖子

来源:Rohan Paul · x.com