fix: update AI extract default model

* fix: update AI extract default model

* fix: update e2e worker node version

* fix: use node lts for e2e worker

* fix: align AI model and CI node version
This commit is contained in:
Dream Hunter
2026-05-10 01:18:23 +08:00
committed by GitHub
parent dd294037ab
commit 437db7c050
13 changed files with 25 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm

View File

@@ -26,7 +26,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm

View File

@@ -19,7 +19,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm
@@ -56,7 +56,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm

View File

@@ -37,7 +37,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm

View File

@@ -15,7 +15,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm
@@ -44,7 +44,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm
@@ -73,7 +73,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
- uses: pnpm/action-setup@v5
name: Install pnpm

View File

@@ -16,6 +16,8 @@
- fix: |Admin| 管理员重置邮箱地址密码时改为前端 SHA-256 后提交,后端只接受并存储哈希值,避免该接口继续接收明文密码
- fix: |Address| 管理员邮箱地址列表与用户绑定地址列表不再返回已存储的地址密码哈希值,避免列表接口暴露敏感字段
- fix: |AI 提取| 将 AI 邮件识别默认 Workers AI 模型切换为支持 JSON Mode 且未弃用的 `@cf/meta/llama-3.1-8b-instruct-fast`,并在文档中补充 `@cf/zai-org/glm-4.7-flash` 结构化输出兼容性提示issue #1029
- fix: |CI| 将 GitHub Actions 与 e2e Docker 镜像统一升级到 Node.js 24适配 Wrangler 4.90.0 的运行时要求
### Improvements

View File

@@ -16,6 +16,8 @@
- fix: |Admin| Hash address passwords in the frontend before admin reset requests, and make the backend accept and store only the hash instead of plaintext
- fix: |Address| Stop returning stored address password hashes from the admin address list and user bound-address list APIs to avoid exposing sensitive fields
- fix: |AI Extract| Switch the default Workers AI model for AI email recognition to the JSON Mode-compatible, non-deprecated `@cf/meta/llama-3.1-8b-instruct-fast`, and document structured-output compatibility guidance for `@cf/zai-org/glm-4.7-flash` (issue #1029)
- fix: |CI| Upgrade GitHub Actions and e2e Docker images to Node.js 24 to satisfy Wrangler 4.90.0 runtime requirements
### Improvements

View File

@@ -1,4 +1,4 @@
FROM node:20-slim
FROM node:24-slim
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
RUN corepack enable && corepack prepare pnpm@10.10.0 --activate

View File

@@ -1,4 +1,4 @@
FROM node:20-slim
FROM node:24-slim
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN corepack enable && corepack prepare pnpm@10.10.0 --activate

View File

@@ -22,7 +22,9 @@ Extraction results are automatically saved to the `metadata` field in the databa
| Variable Name | Type | Description | Example |
| -------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `ENABLE_AI_EMAIL_EXTRACT` | Text/JSON | Whether to enable AI email recognition feature | `true` |
| `AI_EXTRACT_MODEL` | Text | AI model name, choose from [models supporting JSON mode](https://developers.cloudflare.com/workers-ai/features/json-mode/#supported-models) | `@cf/meta/llama-3.1-8b-instruct` |
| `AI_EXTRACT_MODEL` | Text | AI model name, choose from [models supporting JSON mode](https://developers.cloudflare.com/workers-ai/features/json-mode/#supported-models) | `@cf/meta/llama-3.1-8b-instruct-fast` |
We recommend `@cf/meta/llama-3.1-8b-instruct-fast` as the default model because it supports the JSON Mode used by this feature, and Cloudflare says `-fast` variants will remain active. The cheaper `@cf/meta/llama-3.1-8b-instruct-fp8-fast` is not currently listed as a JSON Mode supported model, so it is not recommended for this feature. Cloudflare's newer recommended model `@cf/zai-org/glm-4.7-flash` is suitable for multilingual scenarios, but confirm structured JSON output support in your account/region before using it for this feature. The previous default model `@cf/meta/llama-3.1-8b-instruct` will be deprecated by Cloudflare on 2026-05-30 and is no longer recommended.
## Content Length Limit

View File

@@ -22,7 +22,9 @@ AI 邮件识别功能使用 Cloudflare Workers AI 自动分析收到的邮件内
| 变量名 | 类型 | 说明 | 示例 |
| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
| `ENABLE_AI_EMAIL_EXTRACT` | 文本/JSON | 是否启用 AI 邮件识别功能 | `true` |
| `AI_EXTRACT_MODEL` | 文本 | AI 模型名称,从[支持 JSON 模式的模型](https://developers.cloudflare.com/workers-ai/features/json-mode/#supported-models)中选择 | `@cf/meta/llama-3.1-8b-instruct` |
| `AI_EXTRACT_MODEL` | 文本 | AI 模型名称,从[支持 JSON 模式的模型](https://developers.cloudflare.com/workers-ai/features/json-mode/#supported-models)中选择 | `@cf/meta/llama-3.1-8b-instruct-fast` |
推荐使用 `@cf/meta/llama-3.1-8b-instruct-fast` 作为默认模型,它支持当前实现依赖的 JSON Mode且 Cloudflare 说明 `-fast` 变体会保持可用。价格更低的 `@cf/meta/llama-3.1-8b-instruct-fp8-fast` 目前不在 JSON Mode 支持列表中不建议用于本功能。Cloudflare 推荐的新模型 `@cf/zai-org/glm-4.7-flash` 适合多语言场景,但用于本功能前请先确认它在你的账号/区域支持结构化 JSON 输出。旧默认模型 `@cf/meta/llama-3.1-8b-instruct` 将于 2026-05-30 被 Cloudflare 弃用,不建议继续使用。
## 内容长度限制

View File

@@ -97,7 +97,7 @@ async function extractWithCloudflareAI(
env: Bindings
): Promise<ExtractResult> {
// Get the AI model name from environment variable or use default
const modelName = env.AI_EXTRACT_MODEL || '@cf/meta/llama-3.1-8b-instruct';
const modelName = env.AI_EXTRACT_MODEL || '@cf/meta/llama-3.1-8b-instruct-fast';
const result = await env.AI.run(modelName as keyof AiModels, {
messages: [

View File

@@ -137,8 +137,10 @@ ENABLE_AUTO_REPLY = false
# ENABLE_MAIL_GZIP = true
# AI email extraction, automatically extract verification codes, auth links, etc.
# ENABLE_AI_EMAIL_EXTRACT = true
# AI model name, choose from https://developers.cloudflare.com/workers-ai/models/#text-generation
# AI_EXTRACT_MODEL = "@cf/meta/llama-3.1-8b-instruct"
# AI model name, choose from https://developers.cloudflare.com/workers-ai/features/json-mode/#supported-models
# Recommended JSON Mode model: "@cf/meta/llama-3.1-8b-instruct-fast"
# Note: "@cf/meta/llama-3.1-8b-instruct" will be deprecated by Cloudflare on 2026-05-30
# AI_EXTRACT_MODEL = "@cf/meta/llama-3.1-8b-instruct-fast"
# Calling other woker to process email
# ENABLE_ANOTHER_WORKER = false
# ANOTHER_WORKER_LIST = """