Vercel News

Liquid AI's d1 is available on AI Gateway

8.5内容质量

TL;DR · AI 摘要

Liquid AI的d1模型现已在AI Gateway上发布,支持决策任务和图像处理,提供多种API接入方式。

核心要点

  • d1模型可处理结构化决策任务,无需生成文本token
  • 支持通过OpenAI兼容API和TypeSafe兼容API调用
  • AI Gateway提供模型使用追踪和成本管理功能

结构提纲

按章节快速跳转。

  1. 宣布Liquid AI的d1模型已在AI Gateway上线

  2. d1模型通过结构化问答实现分类、路由和评分

  3. 支持图像输入的视觉分类和评分任务

  4. 提供三种兼容API实现模型调用

  5. 展示退款判断和图像颜色识别的使用案例

  6. AI Gateway提供统一的模型访问和成本追踪

思维导图

用一张图看清主题之间的关系。

查看大纲文本(无障碍 / 无 JS 友好)
  • d1模型发布
    • 核心能力
      • 结构化决策处理
      • 图像视觉分析
    • 接入方式
      • AI SDK API
      • OpenAI兼容API
      • TypeSafe兼容API
    • 平台特性
      • 使用追踪
      • 成本管理

金句 / Highlights

值得收藏与分享的关键句。

#AI模型#API#Vercel#决策系统
打开原文

Liquid AI 的 d1 现已上线 AI Gateway - Vercel

Liquid d1 现已通过 AI Gateway 提供服务。

d1 是一个决策模型,它通过将共享状态与类型化问题进行对比,用于分类、路由和评分。它返回带有概率的结构化答案,而无需生成文本标记。d1 还支持视觉功能:该模型可以回答关于图像的类型化问题,用于视觉分类、检查和评分。

通过 AI SDK 决策 API、兼容 OpenAI 的 Decisions API 或兼容 TypeSafe 的 API 使用 liquid/d1。这些示例询问是否客服代理发放了退款:

API

TypeSafe 兼容

Decisions API

code
1
import
{
experimental_decide
as
decide
}
from
'ai'
;
2
3
const
result
=
await
decide
(
{
4
model
:
'liquid/d1'
,
5
state
:
'The support agent issued a full refund to the customer.'
,
6
questions
:
{
7
refunded
:
{
8
type
:
'boolean'
,
9
instructions
:
'Was a refund issued?'
,
10
}
,
11
}
,
12
}
)
;
13
14
console
.
log
(
result
.
answers
.
refunded
)
;

复制给代理

查看模型详情

↗

复制链接到图像输入标题

此示例读取本地名为 square.png 的 PNG 文件,并询问它显示什么颜色:

AI SDK

code
1
import
{
readFileSync
}
from
'node:fs'
;
2
import
{
experimental_decide
as
decide
}
from
'ai'
;
3
4
const
image
=
readFileSync
(
'./square.png'
)
.
toString
(
'base64'
)
;
5
6
const
result
=
await
decide
(
{
7
model
:
'liquid/d1'
,
8
state
:
[
9
{
10
type
:
'json'
,
11
value
:
[
12
'Which color is the square?'
,
13
{
14
type
:
'image_url'
,
15
image_url
:
{
url
:
`
data:image/png;base64,
${
image
}
`
}
,
16
}
,
17
]
,
18
}
,
19
]
,
20
questions
:
{
21
color
:
{
22
type
:
'choice'
,
23
instructions
:
'What color is the square?'
,
24
criteria
:
{
red
:
null
,
blue
:
null
,
green
:
null
}
,
25
}
,
26
}
,
27
}
)
;
28
29
console
.
log
(
result
.
answers
.
color
)
;

AI Gateway 提供了一种统一的方式访问模型并跟踪使用情况和成本。决策调用会显示在日志中,并与其他模型请求一起计入预算。

请查看决策文档了解关于选择、评分和布尔问题的详细信息,或在 AI Gateway 浏览所有决策模型。