←新闻详情

Rohan Paul更新于 10月21日 22:46

TypeLLM 发布:用 JSON Schema 约束解码实现类型化 LLM 输出

Open source meets type-safe AI, with TypeLLM.

AI 导读

TypeLLM 发布,定位为可在一次 API 调用中执行整个工作流的模型,把整条流程写成一份 JSON Schema,并在单一共享上下文上按依赖图执行。它基于 SGLang 将 JSON Schema 转为约束解码,enum 或 boolean 只保留一个打分 token、数字限定位数,并复用缓存前缀,因此字段不会返回枚举外的值。官方称无需改动权重即可从现成 Qwen checkpoint 获得 schema 保证的输出。

推荐理由

AI 评分 56

原文说明了 TypeLLM 如何用 JSON Schema 约束解码替代模型微调,读者可据此判断结构化输出的实现路径。

主题

标签

引用

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://t.co/GNW18K1iQM https://t.co/YYGne02Fb6

查看原帖

正文

当前显示原文,中文全文译文尚未就绪。

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.

来源

Rohan Paul