feat(llm): raise custom model defaults to 1M context and 128K output
This commit is contained in:
1 parent
ac71b42560
commit
f2e0d7db1b
19 files changed
+89
-31
No files matched your search
@@ -42,11 +42,11 @@
|
||||
- button "删除模型 1"
|
||||
- text: 上下文窗口
|
||||
- textbox "上下文窗口 1":
|
||||
- /placeholder: 256K
|
||||
- /placeholder: 1M
|
||||
- text: 272K
|
||||
- text: 最大输出 token 数
|
||||
- textbox "最大输出 token 数 1":
|
||||
- /placeholder: 32K
|
||||
- /placeholder: 128K
|
||||
- text: 128K
|
||||
- group "输入类型 1":
|
||||
- text: 输入类型
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
- button "删除模型 1"
|
||||
- text: 上下文窗口
|
||||
- textbox "上下文窗口 1":
|
||||
- /placeholder: 256K
|
||||
- /placeholder: 1M
|
||||
- text: 最大输出 token 数
|
||||
- textbox "最大输出 token 数 1":
|
||||
- /placeholder: 32K
|
||||
- /placeholder: 128K
|
||||
- group "输入类型 1":
|
||||
- text: 输入类型
|
||||
- checkbox "文本" [checked]
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
- button "删除模型 1"
|
||||
- text: 上下文窗口
|
||||
- textbox "上下文窗口 1":
|
||||
- /placeholder: 256K
|
||||
- /placeholder: 1M
|
||||
- text: 最大输出 token 数
|
||||
- textbox "最大输出 token 数 1":
|
||||
- /placeholder: 32K
|
||||
- /placeholder: 128K
|
||||
- group "输入类型 1":
|
||||
- text: 输入类型
|
||||
- checkbox "文本"
|
||||
|
||||
@@ -308,6 +308,8 @@ describe('web e2e: Models settings page configures a dormant provider', () => {
|
||||
await custom.getByRole('button', { name: '添加模型', exact: true }).click()
|
||||
await custom.getByLabel('模型 ID 1').fill('acme-large')
|
||||
await custom.getByRole('button', { name: '模型选项 1' }).click()
|
||||
expect(await custom.getByLabel('上下文窗口 1').getAttribute('placeholder')).toBe('1M')
|
||||
expect(await custom.getByLabel('最大输出 token 数 1').getAttribute('placeholder')).toBe('128K')
|
||||
expect(await custom.getByRole('group', { name: '输入类型 1' }).getByRole('checkbox', { name: '图片' }).isChecked()).toBe(false)
|
||||
await custom.getByRole('group', { name: '输入类型 1' }).getByRole('checkbox', { name: '图片' }).check()
|
||||
// The switch seeds off, low, medium, and high rows; this route serves no medium.
|
||||
@@ -322,6 +324,7 @@ describe('web e2e: Models settings page configures a dormant provider', () => {
|
||||
expect(document).toContain('acme-gateway:')
|
||||
expect(document).toContain('reasoningEfforts:')
|
||||
await expect(scaffold.ctx.llm.resolveModelInfo('acme-gateway', 'acme-large')).resolves.toMatchObject({
|
||||
context: { contextWindow: 1_000_000 },
|
||||
inputModalities: ['text', 'image'],
|
||||
reasoning: { efforts: [{ id: 'off', name: 'Off' }, { id: 'low', name: 'Low' }, { id: 'high', name: 'High' }] },
|
||||
})
|
||||
|
||||
@@ -1888,13 +1888,13 @@ export interface PiAiProviderProfile {
|
||||
compat?: PiAiCompatProfile
|
||||
/**
|
||||
* Context capacity for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 262,144). A guess by construction, so
|
||||
* the installed catalog sizes (default 1,000,000). A guess by construction, so
|
||||
* a deployment whose gateway serves smaller models corrects it here.
|
||||
*/
|
||||
defaultContextWindow?: number
|
||||
/**
|
||||
* Output capability for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 32,768). This sizes the model; it
|
||||
* the installed catalog sizes (default 128,000). This sizes the model; it
|
||||
* never becomes a per-request cap on its own.
|
||||
*/
|
||||
defaultMaxTokens?: number
|
||||
|
||||
@@ -1890,13 +1890,13 @@ export interface PiAiProviderProfile {
|
||||
compat?: PiAiCompatProfile
|
||||
/**
|
||||
* Context capacity for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 262,144). A guess by construction, so
|
||||
* the installed catalog sizes (default 1,000,000). A guess by construction, so
|
||||
* a deployment whose gateway serves smaller models corrects it here.
|
||||
*/
|
||||
defaultContextWindow?: number
|
||||
/**
|
||||
* Output capability for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 32,768). This sizes the model; it
|
||||
* the installed catalog sizes (default 128,000). This sizes the model; it
|
||||
* never becomes a per-request cap on its own.
|
||||
*/
|
||||
defaultMaxTokens?: number
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
|
||||
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
||||
# After editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.md
|
||||
/:
|
||||
en: 61a3259e0c1e7893
|
||||
zh: 0c96fdeebcb2368f
|
||||
/pi-ai-default-model-capacities:
|
||||
en: cc30c7c81bcb89eb
|
||||
zh: ee0b1b5f82676f9e
|
||||
/pi-ai-default-model-capacities/change:
|
||||
en: a47430fe02282532
|
||||
zh: 4f8d65358bb36431
|
||||
/pi-ai-default-model-capacities/migration:
|
||||
en: ca3e5882f43f88c3
|
||||
zh: 89d939f046a6ee1d
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "Undescribed pi-ai models inherit larger context and output capacities unless the provider configures explicit defaults."
|
||||
---
|
||||
|
||||
# pi-ai default model capacities
|
||||
|
||||
English | [中文](guide.zh.md)
|
||||
|
||||
## Change
|
||||
|
||||
For models whose capacity is absent from both configuration and the installed catalog, `llm-pi-ai` raises `defaultContextWindow` from 262,144 to 1,000,000 tokens and `defaultMaxTokens` from 32,768 to 128,000 tokens. A larger assumed context window can delay automatic compaction. Explicit model capacities, catalog values, and provider defaults retain their precedence. The output-capacity fallback does not become a Harness request-level `maxTokens` default.
|
||||
|
||||
## Migration
|
||||
|
||||
1. Check the actual limits of custom endpoints. In the `llm-pi-ai` configuration in `cordis.patch.yml`, set `providers.<provider>.defaultContextWindow` and `providers.<provider>.defaultMaxTokens` when those limits differ. To retain the previous defaults, use `262144` and `32768` respectively.
|
||||
2. For models with different limits on the same provider, set `contextWindow` and `maxTokens` on their `providers.<provider>.models` entries. An explicitly configured model `maxTokens` also supplies the Harness request default.
|
||||
3. Reopen the profile configuration and confirm the saved numeric values. See the [provider configuration reference](../../../../packages/llm/llm-pi-ai/README.md).
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
kind: upgrade-guide
|
||||
description: "配置和目录均未描述容量的 pi-ai 模型会继承更大的上下文与输出容量,除非提供方显式配置默认值。"
|
||||
---
|
||||
|
||||
# pi-ai 默认模型容量
|
||||
|
||||
[English](guide.md) | 中文
|
||||
|
||||
## 变更
|
||||
|
||||
对于配置和已安装目录均未提供容量的模型,`llm-pi-ai` 将 `defaultContextWindow` 从 262,144 提高到 1,000,000 tokens,将 `defaultMaxTokens` 从 32,768 提高到 128,000 tokens。更大的假定上下文窗口可能推迟自动压缩。显式模型容量、目录值和提供方默认值仍保留原有优先级。输出容量回退值不会成为 Harness 请求级 `maxTokens` 默认值。
|
||||
|
||||
## 迁移
|
||||
|
||||
1. 核对自定义端点的实际限制。如果限制不同,在 `cordis.patch.yml` 的 `llm-pi-ai` 配置中设置 `providers.<provider>.defaultContextWindow` 和 `providers.<provider>.defaultMaxTokens`。如需保留原默认值,分别填写 `262144` 和 `32768`。
|
||||
2. 同一提供方的模型限制不同时,在相应 `providers.<provider>.models` 条目上设置 `contextWindow` 和 `maxTokens`。显式配置的模型 `maxTokens` 同时提供 Harness 请求默认值。
|
||||
3. 重新打开 profile 配置,确认保存的数值。参见[提供方配置参考](../../../../packages/llm/llm-pi-ai/README.zh.md)。
|
||||
@@ -21,8 +21,8 @@
|
||||
en: f4817eb2e3537ed9
|
||||
zh: e589c193fa85473f
|
||||
/deepseek-ai-dsh-client-ui-settings-models/use-this-package/editing-a-provider:
|
||||
en: 3af73644655c8b7b
|
||||
zh: d689eba772100c63
|
||||
en: 2ab40f99bd12dc17
|
||||
zh: 2b5fd79885cb85fb
|
||||
/deepseek-ai-dsh-client-ui-settings-models/use-this-package/adding-and-deleting-providers:
|
||||
en: 9d533c65c82cd4a4
|
||||
zh: 0a5da334e127c035
|
||||
|
||||
@@ -61,6 +61,8 @@ Expand **Customized settings → Model options** to edit each model. Both provid
|
||||
|
||||
A model row on a hand-declared pi-ai route also edits its **Reasoning levels**, the `reasoningEfforts` the adapter already reads from `cordis.patch.yml`; the **?** beside the label explains the two columns. With the switch off the field is absent, so the model does not reason and the model picker offers no level; a stored `false` is kept until the switch is used. Turning it on always starts from rows for off, low, medium, and high; it does not restore levels removed earlier, and **Cancel** discards the edit instead. Each row pairs a level select — the keys `llm-pi-ai`'s configuration schema accepts in `reasoningEfforts`, read from the namespace schema like the protocol choices and today `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`, each usable once — with the **API value** sent for it, which starts as the level name; a field cleared while typing stores the level name and shows it once the field is left. Off only turns reasoning off, so its value field is disabled; a value already written for it in `cordis.patch.yml` is shown and kept. Changing a row's level resets a value still spelled as the old level; a custom value carries over only between two thinking levels, so changing a row to or from Off resets it. A stored key the schema does not list keeps its row and stays selectable there. Rows can be added and deleted and are saved in row order, while the model picker lists the levels in escalation order. The section refuses what the adapter refuses: no level besides Off — including a `reasoningEfforts:` left without a value, which shows the switch on with no rows — or a value that is missing on a level besides Off or empty on any level. A refused value marks its field invalid, and leaving that field fills in the level name. The rows keep no state of their own, so a model row reused after a deletion, a reset, or a fold shows only its own model. Routes served from the installed catalog and the DeepSeek card keep the adapter's levels and show no reasoning control.
|
||||
|
||||
Empty pi-ai capacity fields display `1M` for the context window and `128K` for maximum output tokens. These hints use decimal K/M units; leaving the fields empty preserves adapter inheritance. Provider-level defaults can differ from the hints.
|
||||
|
||||
### Adding and deleting providers
|
||||
|
||||
**Add model provider** is the one entry to the add card, offered while any editor-backed settings namespace is mounted and enabled while either mode below can proceed. The card opens on a segmented mode switch with a one-line purpose beneath it: **Third-party model provider** carries the dormant-directory provider select over the provider editor — a bare-mounted `llm-pi-ai` offers its whole installed catalog before any route exists — and **Custom model API** carries the create form for a route pi-ai does not ship: a relay, a self-hosted server, or any other OpenAI- or Anthropic-compatible endpoint. A mode is offered only while its namespace is mounted; with one mode the card shows that form alone under the mode's name, and a mode whose namespace has nothing left to adopt or no protocol to declare is disabled with the reason as its hover text. A panel mounts the first time its mode is shown and stays mounted, hidden, while the card is open and its mode stays offered, so switching modes discards neither draft; the switch locks while either panel has a write or an endpoint interrogation in flight, since a switch underneath one would orphan its answer. Each tab controls its panel through ids, and closing either panel forgets the catalog draft's target. The custom form asks for a unique **Provider ID**, an endpoint, a protocol, and at least one uniquely-identified model, because nothing can default those. The protocol picker names each protocol by its product name — OpenAI Chat Completions, OpenAI Responses, Anthropic Messages — while the stored value stays the schema identifier; a protocol the adapter adds before this page names it shows that identifier. The endpoint placeholder follows the selected protocol: OpenAI Chat Completions and Responses show `https://gateway.example/v1`, while Anthropic Messages shows `https://gateway.example` because its SDK appends `/v1/messages`. Changing the protocol preserves any address already entered. The endpoint must be a parseable HTTP or HTTPS URL; localhost, IPv4 and IPv6 literals, and custom ports remain valid. A syntax error blocks both discovery and creation at the field, while a request failure remains a separate provider error. **Fetch available models** asks the `llm/discoverModels` Remote about the endpoint the form shows, so adding a provider is one pass instead of save-then-return; the reply opens a searchable picker rather than being written, and nothing is written until **Add selected**. Each candidate displays its original model id in a monospace font to distinguish models with the same name. Rows stay on one line; hovering reveals the model name, falling back to the full id when no name is supplied. Selection and configuration retain the original model id. Each selected candidate copies its id, display name, context window, output-token cap, and disclosed input types into the editable row when disclosed, while an existing row retains its user-tuned values. Search matches model ids and optional display names without clearing hidden selections. **Select all** adds the visible results, while **Deselect all** clears the entire selection so hidden results cannot be adopted accidentally. A row is deletable only when the user layer alone carries it (removal restores the composition base), and its confirmation dialog names the provider.
|
||||
|
||||
@@ -61,6 +61,8 @@ API 密钥输入框初始为空,并通过 `autocomplete="new-password"` 请求
|
||||
|
||||
手工声明的 pi-ai 路由上,模型行还会编辑**推理等级**,即适配器本来就从 `cordis.patch.yml` 读取的 `reasoningEfforts`;标签旁的 **?** 说明两列的含义。开关关闭时该字段不存在,模型不推理,模型选择器不提供任何档位;已存储的 `false` 在开关被操作前保持不变。打开开关总是从 off、low、medium 和 high 四行开始,不会恢复之前删掉的档位;要放弃修改请点**取消**。每行把一个档位选择框——可选值是 `llm-pi-ai` 配置 schema 允许作为 `reasoningEfforts` 键的档位,与协议选项一样从命名空间 schema 读取,目前为 `off`、`minimal`、`low`、`medium`、`high`、`xhigh`、`max`,每个档位只能用一次——与发送给它的 **API 参数值**配成一对,参数值初始为档位名;输入时清空的字段会存为档位名,离开字段后显示出来。Off 只表示关闭思考,因此它的参数值输入框是禁用的;`cordis.patch.yml` 中已为它写好的值会显示并保留。修改某行的档位时,仍是旧档位名的参数值会随之重置;自定义值只在两个思考档位之间保留,切到或切离 Off 都会重置。schema 未列出的已存键会保留自己的行,并可在该行中继续选择。行可以增删,并按行的顺序保存,模型选择器则按升级顺序列出档位。本节拒绝适配器会拒绝的配置:没有 Off 以外的档位(包括未写值的 `reasoningEfforts:`,此时开关显示为打开且没有任何行),或者 Off 以外的档位缺少参数值、任意档位的参数值为空字符串。被拒绝的值会把对应输入框标为无效,离开该输入框时会填入档位名。各行不保留自己的状态,因此删除、恢复默认或折叠之后被复用的模型行只显示它自己的模型。走已安装目录的路由和 DeepSeek 卡片沿用适配器的档位,不显示推理等级控件。
|
||||
|
||||
pi-ai 容量字段为空时,上下文窗口显示 `1M`,最大输出 token 数显示 `128K`。这些提示使用十进制 K/M 单位;保留空值会继续继承适配器配置。提供方级默认值可能与提示不同。
|
||||
|
||||
### 新增与删除提供商
|
||||
|
||||
**添加模型提供商**是新增卡片的唯一入口:只要任一带编辑器的设置 namespace 已挂载就会出现,下述两种方式任一可继续时才可点击。卡片打开后顶部是分段式的方式切换,下方一行小字说明所选方式的用途:**第三方模型提供商**承载休眠目录提供商选择框与提供商编辑器——裸挂载的 `llm-pi-ai` 在任何路由存在之前就能提供其完整的已安装 catalog;**自定义模型 API**承载为 pi-ai 不提供的路由(中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口)准备的创建表单。某种方式只在其 namespace 已挂载时提供;只剩一种方式时卡片以该方式为标题直接显示表单;namespace 已无可采用的提供商或没有可声明的协议时,对应方式会被禁用并把原因作为悬停提示。面板在其方式首次显示时挂载,之后在卡片打开且该方式仍被提供期间保持挂载但隐藏,因此切换方式不会丢掉任何一边的草稿;任一面板有写入或端点探测进行中时滑块锁定,因为此时切换会让结果落到看不见的面板上。每个 tab 通过 id 控制其面板,关闭任一面板都会忘记目录草稿的目标。自定义表单会索要唯一的 **Provider ID**、端点、协议与至少一个可唯一识别的模型,因为没有东西能为它们兜底。协议选择框以产品名称显示各协议——OpenAI Chat Completions、OpenAI Responses、Anthropic Messages——存储的值仍是 schema 标识符;适配器新增而本页尚未命名的协议直接显示其标识符。端点占位示例随所选协议变化:OpenAI Chat Completions 与 Responses 显示 `https://gateway.example/v1`,Anthropic Messages 显示 `https://gateway.example`,因为其 SDK 会追加 `/v1/messages`。切换协议会保留已输入的地址。端点必须是可解析的 HTTP 或 HTTPS URL;localhost、IPv4 与 IPv6 字面地址以及自定义端口仍然有效。语法错误会在字段处阻止询问与创建,请求失败则继续作为独立的提供商错误显示。**获取可用模型**通过 `llm/discoverModels` Remote 查询表单显示的端点,因此新增提供商一次即可完成,而非先保存再返回;回复打开的是可搜索选择器而非直接写入,只有点击**添加所选**才会写入。候选项使用等宽字体显示原始模型 id,以区分同名模型。每行保持单行,悬停可查看模型名称,未提供名称时回退到完整 id。勾选与配置仍使用原始模型 id。每个选中候选会在提供商公布相应信息时,把 id、显示名、上下文窗口、最大输出 token 数和已公布的输入类型复制进可编辑行;已经存在的行保留用户调整过的值。搜索会匹配模型 id 与可选显示名称,且不会清除隐藏项的勾选状态。**全选**会加入可见结果,而**取消全选**会清空全部勾选,以免意外采用隐藏结果。只有用户层单独携带某行时,该行才可删除(删除会恢复组合基线),其确认对话框会指名该提供商。
|
||||
|
||||
@@ -112,16 +112,13 @@ type CapacityField = 'contextWindow' | 'maxTokens'
|
||||
* What an empty capacity field is worth, shown as its placeholder so a row left
|
||||
* blank does not read as a model with no capacity at all.
|
||||
*
|
||||
* The magnitudes are the adapter's own route-level fallbacks (`llm-pi-ai`'s
|
||||
* `defaultContextWindow` and `defaultMaxTokens`), spelled the way a person
|
||||
* would say them. They are a hint, not a mirror: this page counts `K` as 1000,
|
||||
* so typing `256K` stores 256000 while leaving the field blank keeps the
|
||||
* adapter's 262144. A deployment that overrides those defaults is not
|
||||
* reflected here — nothing on this page can read them.
|
||||
* These hints match llm-pi-ai's built-in `defaultContextWindow` and
|
||||
* `defaultMaxTokens` in decimal K/M notation. Provider overrides are not
|
||||
* available to this component and are not reflected in the hints.
|
||||
*/
|
||||
const CAPACITY_HINT: Readonly<Record<CapacityField, string>> = {
|
||||
contextWindow: '256K',
|
||||
maxTokens: '32K',
|
||||
contextWindow: '1M',
|
||||
maxTokens: '128K',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -310,6 +310,8 @@ describe('model list editing', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: en.addModel }))
|
||||
fireEvent.change(screen.getByLabelText(`${en.modelId} 1`), { target: { value: 'acme-large' } })
|
||||
expandModel(1)
|
||||
expect(screen.getByLabelText<HTMLInputElement>(`${en.contextWindow} 1`).placeholder).toBe('1M')
|
||||
expect(screen.getByLabelText<HTMLInputElement>(`${en.maxTokens} 1`).placeholder).toBe('128K')
|
||||
fireEvent.change(screen.getByLabelText(`${en.contextWindow} 1`), { target: { value: '65536' } })
|
||||
fireEvent.click(within(screen.getByRole('group', { name: `${en.modelInputTypes} 1` })).getByRole('checkbox', { name: en.modelInputImage }))
|
||||
fireEvent.change(screen.getByLabelText(`${en.modelName} 1`), { target: { value: 'Acme' } })
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
en: f3b761c7c7ecb82f
|
||||
zh: e10d999aa348ef86
|
||||
/deepseek-ai-dsh-llm-pi-ai/use-this-package/configure-provider-routes:
|
||||
en: c5d28300fa2cfc6f
|
||||
zh: c162855dcb54b65b
|
||||
en: 738edb4ae053740d
|
||||
zh: cc6853e2bdac01ec
|
||||
/deepseek-ai-dsh-llm-pi-ai/use-this-package/sign-in-to-a-provider:
|
||||
en: c36f66438638ae08
|
||||
zh: 066a2fc4cb97c86f
|
||||
|
||||
@@ -81,8 +81,8 @@ Each profile may set a `retryPolicy`; omission uses normal mode with five retrie
|
||||
| `models` | installed catalog | Replaces the route's catalog wholesale; each entry defaults from the installed model |
|
||||
| `modelOverrides` | none | Reshapes individual installed-catalog models without replacing the rest |
|
||||
| `compat` | catalog detection | Wire-compatibility switches for unrecognized endpoints |
|
||||
| `defaultContextWindow` | `262,144` | Capacity fallback for undescribed models |
|
||||
| `defaultMaxTokens` | `32,768` | Output-cap fallback for undescribed models |
|
||||
| `defaultContextWindow` | `1,000,000` | Capacity fallback for undescribed models |
|
||||
| `defaultMaxTokens` | `128,000` | Output-cap fallback for undescribed models |
|
||||
| `requestImagePixelBudget` | `4,194,304` | Total-pixel budget for each deterministic request image |
|
||||
| `requestImageMaxBytes` | `1 MiB` | Encoded-byte target for each request image before base64 expansion |
|
||||
| `maxRequestImageBytes` | `20 MiB` | Aggregate base64 image-payload bound; a request whose retained images exceed it fails with `IMAGE_OFFLOAD_REQUIRED` |
|
||||
|
||||
@@ -81,8 +81,8 @@ kind: "package-reference"
|
||||
| `models` | 已安装目录 | 整体替换路由目录;每个条目从已安装模型取默认值 |
|
||||
| `modelOverrides` | 无 | 重塑个别已安装目录模型,而不替换其余模型 |
|
||||
| `compat` | 目录检测 | 无法识别端点的协议兼容开关 |
|
||||
| `defaultContextWindow` | `262,144` | 未描述模型的容量回退 |
|
||||
| `defaultMaxTokens` | `32,768` | 未描述模型的输出上限回退 |
|
||||
| `defaultContextWindow` | `1,000,000` | 未描述模型的容量回退 |
|
||||
| `defaultMaxTokens` | `128,000` | 未描述模型的输出上限回退 |
|
||||
| `requestImagePixelBudget` | `4,194,304` | 每张确定性请求图片的总像素预算 |
|
||||
| `requestImageMaxBytes` | `1 MiB` | 每张请求图片在 base64 扩展前的编码字节目标 |
|
||||
| `maxRequestImageBytes` | `20 MiB` | base64 图片载荷总上限,保留图片超过时请求以 `IMAGE_OFFLOAD_REQUIRED` 失败 |
|
||||
|
||||
@@ -62,10 +62,10 @@ export const DEFAULT_REQUEST_IMAGE_PIXEL_BUDGET = 2048 * 2048
|
||||
export const DEFAULT_REQUEST_IMAGE_MAX_BYTES = 1024 * 1024
|
||||
|
||||
/** Context capacity assumed for a model neither configuration nor the catalog sizes. */
|
||||
export const DEFAULT_CONTEXT_WINDOW = 262_144
|
||||
export const DEFAULT_CONTEXT_WINDOW = 1_000_000
|
||||
|
||||
/** Output capability assumed for a model neither configuration nor the catalog sizes. */
|
||||
export const DEFAULT_MAX_TOKENS = 32_768
|
||||
export const DEFAULT_MAX_TOKENS = 128_000
|
||||
|
||||
/**
|
||||
* Modalities assumed for a model neither configuration nor the catalog
|
||||
@@ -127,13 +127,13 @@ export interface PiAiProviderProfile {
|
||||
compat?: PiAiCompatProfile
|
||||
/**
|
||||
* Context capacity for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 262,144). A guess by construction, so
|
||||
* the installed catalog sizes (default 1,000,000). A guess by construction, so
|
||||
* a deployment whose gateway serves smaller models corrects it here.
|
||||
*/
|
||||
defaultContextWindow?: number
|
||||
/**
|
||||
* Output capability for a model this route lists that neither the entry nor
|
||||
* the installed catalog sizes (default 32,768). This sizes the model; it
|
||||
* the installed catalog sizes (default 128,000). This sizes the model; it
|
||||
* never becomes a per-request cap on its own.
|
||||
*/
|
||||
defaultMaxTokens?: number
|
||||
|
||||
@@ -170,7 +170,7 @@ describe('hand-declared providers', () => {
|
||||
resolved.get(route)?.piProvider?.getModels() ?? []
|
||||
|
||||
expect(modelsOf('acme-gateway')).toMatchObject([
|
||||
{ id: 'bare', contextWindow: 262_144, maxTokens: 32_768 },
|
||||
{ id: 'bare', contextWindow: 1_000_000, maxTokens: 128_000 },
|
||||
{ id: 'sized', contextWindow: 8192, maxTokens: 512 },
|
||||
])
|
||||
// The fallback is a guess, so a deployment whose gateway serves smaller
|
||||
|
||||
Reference in new issue
Block a user