@skyphusion/create-prism 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/MIGRATIONS.md +30 -0
- package/template/README.md +50 -37
- package/template/package.json +3 -3
- package/template/src/longrun-params.ts +2 -0
- package/template/src/models.ts +64 -15
- package/template/src/parsers/workers-ai-sse.ts +1 -1
- package/template/src/routes/chat.ts +15 -23
- package/template/src/routes/conversations.ts +3 -1
- package/template/src/routes/projects.ts +5 -4
- package/template/src/routes/rag.ts +39 -16
- package/template/src/vector-id.ts +27 -0
- package/template/src/version.ts +1 -1
- package/template/tests/catalog-refresh-2026-12.test.ts +111 -0
- package/template/tests/log-identity-guard.test.ts +88 -0
- package/template/tests/rag-retrieval-diagnostic.test.ts +89 -80
- package/template/tests/rag-vector-id.test.ts +154 -0
- package/template/tests/sprint2-catalog.test.ts +9 -6
- package/template/tests/vectorize-rekey-vector-ids.test.ts +141 -0
- package/template/tests/wrangler-template.test.ts +32 -0
- package/template/wrangler.example.toml +12 -11
package/package.json
CHANGED
package/template/MIGRATIONS.md
CHANGED
|
@@ -247,3 +247,33 @@ var.
|
|
|
247
247
|
bytes would share an index entry. The D1 join still scopes their results correctly, so the worst case
|
|
248
248
|
for those users is the old global behaviour, not a disclosure.
|
|
249
249
|
|
|
250
|
+
|
|
251
|
+
## Vector ids without identity (prism#232)
|
|
252
|
+
|
|
253
|
+
**Why.** Before prism#232, ingest minted each Vectorize vector id as `<identity>:<document id>:<chunk
|
|
254
|
+
index>`. In access mode the identity is the raw email address, so every id in the index carried it.
|
|
255
|
+
Vector ids are visible outside D1: in the index, in query results, and in any tool that lists or
|
|
256
|
+
exports ids. New ingests mint a random id (`c_` plus 32 hex digits, `src/vector-id.ts`). Ownership
|
|
257
|
+
stays in the vector's `user_email` metadata and the D1 `chunks` row.
|
|
258
|
+
|
|
259
|
+
**Nothing breaks if you do nothing.** Every reader (retrieval, document delete, account delete) looks
|
|
260
|
+
ids up through D1 `chunks.vector_id`, so old ids keep working next to new ones. Public-mode ids carry
|
|
261
|
+
the opaque `usr_` id, not an email, and are left alone.
|
|
262
|
+
|
|
263
|
+
**To remove the emails from existing ids** (access-mode deployments only), re-key them. The script
|
|
264
|
+
selects the D1 rows whose `vector_id` contains `@`, writes each vector under a new random id with the
|
|
265
|
+
same values and metadata (nothing is re-embedded), points the D1 row at the new id, then deletes the old
|
|
266
|
+
id. It prints counts only, never an id or a value, and is safe to re-run.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... \
|
|
270
|
+
node scripts/vectorize-rekey-vector-ids.mjs --index skyphusion-llm-vec --d1 <D1 database uuid> --dry-run
|
|
271
|
+
CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... \
|
|
272
|
+
node scripts/vectorize-rekey-vector-ids.mjs --index skyphusion-llm-vec --d1 <D1 database uuid>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
The token needs Vectorize Edit and D1 Edit. `legacy` in the dry-run output is the number of
|
|
276
|
+
email-bearing ids. Exit 0 means every one was re-keyed. Exit 1 means some D1 ids had no vector (`gaps`)
|
|
277
|
+
or a row changed during the run (`conflicts`). Exit 2 means it refused or could not read. Vectorize
|
|
278
|
+
applies writes asynchronously, so retrieval for a re-keyed chunk can miss for a few seconds after its
|
|
279
|
+
batch; run it in a quiet window.
|
package/template/README.md
CHANGED
|
@@ -82,23 +82,27 @@ One Worker, no framework, no build step beyond TypeScript. The interesting parts
|
|
|
82
82
|
|
|
83
83
|
## Features
|
|
84
84
|
|
|
85
|
-
**Full model catalog (
|
|
85
|
+
**Full model catalog (107 entries):** tables below are generated from `src/models.ts`. Live list always wins: `GET /api/models`. The commercial control plane ([prism-control-plane](https://github.com/skyphusion-labs/prism-control-plane)) mirrors the same ids in `src/catalog.ts`.
|
|
86
86
|
|
|
87
87
|
| Modality | Count |
|
|
88
88
|
| --- | ---: |
|
|
89
|
-
| Chat |
|
|
90
|
-
| Image |
|
|
91
|
-
| Video |
|
|
92
|
-
| Text-to-speech (TTS) |
|
|
93
|
-
| Speech-to-text (STT) |
|
|
89
|
+
| Chat | 57 |
|
|
90
|
+
| Image | 23 |
|
|
91
|
+
| Video | 20 |
|
|
92
|
+
| Text-to-speech (TTS) | 2 |
|
|
93
|
+
| Speech-to-text (STT) | 3 |
|
|
94
94
|
| Music | 1 |
|
|
95
95
|
| Live voice (Flux) | 1 |
|
|
96
|
-
| **Total** | **
|
|
96
|
+
| **Total** | **107** |
|
|
97
97
|
|
|
98
|
-
#### Chat (
|
|
98
|
+
#### Chat (57)
|
|
99
99
|
|
|
100
100
|
| Model id | Notes |
|
|
101
101
|
| --- | --- |
|
|
102
|
+
| `anthropic/claude-fable-5.2` | Anthropic; binding |
|
|
103
|
+
| `anthropic/claude-opus-5.5` | Anthropic; binding |
|
|
104
|
+
| `anthropic/claude-sonnet-5.5` | Anthropic; binding |
|
|
105
|
+
| `anthropic/claude-haiku-5.5` | Anthropic; binding |
|
|
102
106
|
| `anthropic/claude-fable-5` | Anthropic; binding |
|
|
103
107
|
| `anthropic/claude-sonnet-5` | Anthropic |
|
|
104
108
|
| `anthropic/claude-opus-5` | Anthropic |
|
|
@@ -107,18 +111,28 @@ One Worker, no framework, no build step beyond TypeScript. The interesting parts
|
|
|
107
111
|
| `anthropic/claude-opus-4-6` | Anthropic |
|
|
108
112
|
| `anthropic/claude-sonnet-4-6` | Anthropic |
|
|
109
113
|
| `anthropic/claude-haiku-4-5` | Anthropic |
|
|
114
|
+
| `xai/grok-4.7` | xAI; binding |
|
|
110
115
|
| `xai/grok-4.5` | xAI |
|
|
111
116
|
| `xai/grok-4.3` | xAI |
|
|
112
117
|
| `xai/grok-4.20-multi-agent-0309` | xAI multi-agent |
|
|
113
118
|
| `xai/grok-4.20-0309-reasoning` | xAI reasoning |
|
|
114
119
|
| `moonshotai/kimi-k3` | Moonshot UB |
|
|
115
|
-
|
|
|
116
|
-
|
|
|
120
|
+
| `moonshotai/kimi-k3.1-pro` | Moonshot UB |
|
|
121
|
+
| `alibaba/qwen3.8-max` | Alibaba UB |
|
|
122
|
+
| `deepseek/deepseek-v4-pro` | DeepSeek UB |
|
|
123
|
+
| `minimax/m3` | MiniMax UB |
|
|
124
|
+
| `@cf/deepseek-ai/deepseek-v4.1-flash-1017` | Workers AI, vision |
|
|
125
|
+
| `@cf/zai-org/glm-5.3` | Workers AI |
|
|
126
|
+
| `@cf/thinkingmachines/inkling-2-small` | Workers AI, vision |
|
|
117
127
|
| `@cf/openai/gpt-oss-120b` | Workers AI, reasoning |
|
|
118
128
|
| `@cf/meta/llama-4-scout-17b-16e-instruct` | Workers AI, vision |
|
|
119
129
|
| `@cf/google/gemma-4-26b-a4b-it` | Workers AI, vision |
|
|
120
130
|
| `@cf/openai/gpt-oss-20b` | Workers AI |
|
|
121
131
|
| `openai/gpt-5.5` | OpenAI UB |
|
|
132
|
+
| `openai/gpt-6.2-astra` | OpenAI UB |
|
|
133
|
+
| `openai/gpt-6.2-sol` | OpenAI UB |
|
|
134
|
+
| `openai/gpt-6.1-terra` | OpenAI UB |
|
|
135
|
+
| `openai/gpt-6-luna` | OpenAI UB |
|
|
122
136
|
| `openai/gpt-5.5-pro` | OpenAI Responses |
|
|
123
137
|
| `openai/gpt-5.6-sol` | OpenAI Responses |
|
|
124
138
|
| `openai/gpt-5.6-terra` | OpenAI Responses |
|
|
@@ -128,54 +142,56 @@ One Worker, no framework, no build step beyond TypeScript. The interesting parts
|
|
|
128
142
|
| `openai/o4-mini` | OpenAI reasoning |
|
|
129
143
|
| `@cf/meta/llama-3.3-70b-instruct-fp8-fast` | Workers AI |
|
|
130
144
|
| `@cf/meta/llama-3.2-11b-vision-instruct` | Workers AI, vision |
|
|
131
|
-
| `@cf/meta/llama-3.2-3b-instruct` | Workers AI |
|
|
132
|
-
| `@cf/qwen/qwen3-30b-a3b-fp8` | Workers AI |
|
|
133
|
-
| `@cf/qwen/qwq-32b` | Workers AI, reasoning |
|
|
134
145
|
| `@cf/qwen/qwen2.5-coder-32b-instruct` | Workers AI |
|
|
135
|
-
| `@cf/
|
|
146
|
+
| `@cf/qwen/qwen3.8-27b` | Workers AI, vision |
|
|
136
147
|
| `@cf/mistralai/mistral-small-3.1-24b-instruct` | Workers AI, vision |
|
|
137
148
|
| `@cf/zai-org/glm-4.7-flash` | Workers AI |
|
|
138
|
-
| `@cf/zai-org/glm-5.2` | Workers AI |
|
|
139
|
-
| `@cf/nvidia/nemotron-3-120b-a12b` | Workers AI |
|
|
140
149
|
| `@cf/aisingapore/gemma-sea-lion-v4-27b-it` | Workers AI |
|
|
141
150
|
| `google/gemini-3.1-pro` | Google Gemini, binding |
|
|
142
151
|
| `google/gemini-3.5-flash` | Google Gemini, binding |
|
|
143
152
|
| `google/gemini-3.6-flash` | Google Gemini, binding |
|
|
153
|
+
| `google/gemini-3.8-flash` | Google Gemini, binding |
|
|
154
|
+
| `google/gemini-4-argon` | Google Gemini, binding |
|
|
155
|
+
| `google/gemini-4-carbon` | Google Gemini, binding |
|
|
156
|
+
| `google/gemini-4-neon` | Google Gemini, binding |
|
|
157
|
+
| `google/gemini-4-hydrogen` | Google Gemini, binding |
|
|
144
158
|
| `@cf/ibm-granite/granite-4.0-h-micro` | Workers AI |
|
|
145
|
-
| `@cf/meta/llama-3.2-1b-instruct` | Workers AI |
|
|
146
159
|
|
|
147
|
-
#### Image (
|
|
160
|
+
#### Image (23)
|
|
148
161
|
|
|
149
162
|
| Model id | Notes |
|
|
150
163
|
| --- | --- |
|
|
151
164
|
| `google/nano-banana-pro` | Google UB |
|
|
152
165
|
| `google/nano-banana-2` | Google UB |
|
|
153
166
|
| `google/nano-banana-2-lite` | Google UB |
|
|
167
|
+
| `google/nano-banana-2.1` | Google UB |
|
|
154
168
|
| `google/imagen-4` | Google UB |
|
|
155
169
|
| `openai/gpt-image-1.5` | OpenAI UB; transparent PNG needs `OPENAI_API_KEY` |
|
|
156
170
|
| `openai/gpt-image-2` | OpenAI UB; transparent PNG needs `OPENAI_API_KEY` |
|
|
157
171
|
| `recraft/recraftv4` | Recraft UB |
|
|
158
172
|
| `recraft/recraftv4-1` | Recraft UB |
|
|
159
173
|
| `recraft/recraftv4-1-pro` | Recraft UB |
|
|
174
|
+
| `recraft/recraftv4-1-flash` | Recraft UB |
|
|
160
175
|
| `xai/grok-imagine-image` | xAI UB |
|
|
161
176
|
| `xai/grok-imagine-image-quality` | xAI UB |
|
|
177
|
+
| `xai/grok-imagine-image-2.0` | xAI UB |
|
|
162
178
|
| `bytedance/seedream-5-pro` | ByteDance UB |
|
|
163
179
|
| `bytedance/seedream-5-lite` | ByteDance UB |
|
|
180
|
+
| `bytedance/seedream-5.5` | ByteDance UB |
|
|
164
181
|
| `@cf/black-forest-labs/flux-2-klein-9b` | FLUX 2; up to 4 refs |
|
|
165
182
|
| `@cf/black-forest-labs/flux-2-klein-4b` | FLUX 2; up to 4 refs |
|
|
166
183
|
| `@cf/black-forest-labs/flux-2-dev` | FLUX 2 multi-reference |
|
|
167
184
|
| `@cf/black-forest-labs/flux-1-schnell` | FLUX-1 fast |
|
|
168
185
|
| `@cf/leonardo/lucid-origin` | Leonardo |
|
|
169
186
|
| `@cf/leonardo/phoenix-1.0` | Leonardo |
|
|
170
|
-
| `@cf/lykon/dreamshaper-8-lcm` | Fast SD |
|
|
171
|
-
| `@cf/stabilityai/stable-diffusion-xl-base-1.0` | SDXL |
|
|
172
187
|
|
|
173
|
-
#### Video (
|
|
188
|
+
#### Video (20)
|
|
174
189
|
|
|
175
190
|
| Model id | Notes |
|
|
176
191
|
| --- | --- |
|
|
177
192
|
| `google/veo-3.1` | Workflow long-run |
|
|
178
193
|
| `google/veo-3.1-fast` | Workflow long-run |
|
|
194
|
+
| `bytedance/seedance-2.5` | Workflow long-run; i2v |
|
|
179
195
|
| `bytedance/seedance-2.0` | Workflow long-run |
|
|
180
196
|
| `bytedance/seedance-2.0-fast` | Workflow long-run |
|
|
181
197
|
| `bytedance/seedance-2.0-mini` | Workflow long-run |
|
|
@@ -194,21 +210,19 @@ One Worker, no framework, no build step beyond TypeScript. The interesting parts
|
|
|
194
210
|
| `vidu/q3-pro` | Workflow long-run |
|
|
195
211
|
| `vidu/q3-turbo` | Workflow long-run |
|
|
196
212
|
|
|
197
|
-
#### TTS (
|
|
213
|
+
#### TTS (2)
|
|
198
214
|
|
|
199
215
|
| Model id | Notes |
|
|
200
216
|
| --- | --- |
|
|
201
217
|
| `@cf/deepgram/aura-2-en` | English |
|
|
202
218
|
| `@cf/deepgram/aura-2-es` | Spanish speakers |
|
|
203
|
-
| `@cf/myshell-ai/melotts` | Multilingual |
|
|
204
219
|
|
|
205
|
-
#### STT (
|
|
220
|
+
#### STT (3)
|
|
206
221
|
|
|
207
222
|
| Model id | Notes |
|
|
208
223
|
| --- | --- |
|
|
209
224
|
| `@cf/openai/whisper-large-v3-turbo` | Best quality |
|
|
210
225
|
| `@cf/openai/whisper` | General |
|
|
211
|
-
| `@cf/openai/whisper-tiny-en` | Fast English |
|
|
212
226
|
| `@cf/deepgram/nova-3` | Accurate batch |
|
|
213
227
|
|
|
214
228
|
#### Music (1)
|
|
@@ -397,7 +411,7 @@ Do **not** use a **Bypass** policy on the main app URL. Bypass skips login, so t
|
|
|
397
411
|
|
|
398
412
|
### 7. Optional: web search
|
|
399
413
|
|
|
400
|
-
Web search calls
|
|
414
|
+
Web search calls a `skyphusion-search` Worker through a service binding. search-mcp, which built that Worker, is retired, so the template ships the block commented out and web search is off by default (a replacement backend is tracked in #276). If you run that Worker, uncomment the block:
|
|
401
415
|
|
|
402
416
|
```toml
|
|
403
417
|
[[services]]
|
|
@@ -406,7 +420,7 @@ service = "skyphusion-search"
|
|
|
406
420
|
entrypoint = "SearchEntrypoint"
|
|
407
421
|
```
|
|
408
422
|
|
|
409
|
-
|
|
423
|
+
Leave it commented out if you do not run a worker with that script name: `wrangler deploy` fails with error 10143 when the service does not exist. With the binding absent, the response says that source is `absent` and Wikipedia still runs. Wikipedia needs no config. See [Web search](#web-search) below.
|
|
410
424
|
|
|
411
425
|
### 8. Local development
|
|
412
426
|
|
|
@@ -483,7 +497,7 @@ npm run deploy
|
|
|
483
497
|
|
|
484
498
|
- **You (the host)** pay Cloudflare for Workers, D1, R2, and Vectorize: the storage and compute for the service itself.
|
|
485
499
|
- **Each user** pays for every call that goes through the `aiRun` seam or a provider-native gateway endpoint, on their own Cloudflare account and gateway (v1.1.0): all partner models (Anthropic, xAI, Google, OpenAI, and the other Unified Billing providers, including image, video, and music), Workers AI chat, TTS, Whisper STT, FLUX.1 / Lucid Origin image gen, and the RAG embeddings (`@cf/baai/bge-base-en-v1.5`) behind document upload and retrieval.
|
|
486
|
-
- **You (the host)** pay for the Workers AI paths that call the worker's `AI` binding directly because AI Gateway cannot proxy them, which means the user's account cannot be reached either: the
|
|
500
|
+
- **You (the host)** pay for the Workers AI paths that call the worker's `AI` binding directly because AI Gateway cannot proxy them, which means the user's account cannot be reached either: the four stream-incompatible image models (FLUX.2 Klein 9B / Klein 4B / Dev, Leonardo Phoenix 1.0), Deepgram file STT, and the live-voice Flux socket. Bound this with Workers AI limits on your account or remove those models from `src/models.ts` on your instance.
|
|
487
501
|
- **Control-plane users** (`pcp_` key) bill chat through prism-control-plane under its own metering, not through either account above. That plane stores no chat text. Media it generates, and reference images uploaded to it, are kept 30 days and then deleted ([its retention section](https://github.com/skyphusion-labs/prism-control-plane/blob/main/docs/CONTRACT.md)).
|
|
488
502
|
|
|
489
503
|
**How it works.** In `AUTH_MODE=public`, the host funds a named set of demo capabilities on purpose. Every other inference call bills the user's own Cloudflare account.
|
|
@@ -494,7 +508,7 @@ This table was read from the code on `main` (v1.1.1). It shows what the code doe
|
|
|
494
508
|
|
|
495
509
|
| Capability | Code path | Billed to |
|
|
496
510
|
|---|---|---|
|
|
497
|
-
| FLUX.2 Klein 9B, Klein 4B, Dev; Leonardo Phoenix 1.0
|
|
511
|
+
| FLUX.2 Klein 9B, Klein 4B, Dev; Leonardo Phoenix 1.0 | `bypassGateway` in `src/routes/chat.ts` calls `env.AI.run` | **Host** |
|
|
498
512
|
| Deepgram Nova-3 file speech-to-text | `viaDeepgram` in `src/routes/chat.ts` calls `env.AI.run` | **Host** |
|
|
499
513
|
| Live voice (Deepgram Flux websocket) | `src/stt-session.ts` calls `env.AI.run` | **Host** |
|
|
500
514
|
| Workers AI chat, TTS, Whisper, FLUX.1 schnell, Lucid Origin | `aiRun`, which uses the REST API on the user's account | User |
|
|
@@ -756,13 +770,12 @@ Video gen is the most expensive feature in this playground.
|
|
|
756
770
|
|
|
757
771
|
Attach an audio file, pick a Whisper model, click Run. The worker calls Whisper directly via `env.AI.run` (no async; Whisper completes in seconds) and stores the transcript as the chat's `output` text. The audio's bytes are not persisted; only the transcript is kept on the row's attachment record, same convention as the chat-path audio attachments.
|
|
758
772
|
|
|
759
|
-
|
|
773
|
+
Three one-shot models are exposed:
|
|
760
774
|
- `@cf/openai/whisper-large-v3-turbo` (default; best quality, multilingual)
|
|
761
775
|
- `@cf/openai/whisper` (general purpose, slightly older)
|
|
762
|
-
- `@cf/openai/whisper-tiny-en` (fast, English-only, beta)
|
|
763
776
|
- `@cf/deepgram/nova-3` (Deepgram Nova-3; accurate)
|
|
764
777
|
|
|
765
|
-
All
|
|
778
|
+
All three are hosted on Workers AI (no Unified Billing needed). Cloudflare retired `@cf/openai/whisper-tiny-en` on 2026-11-20 and names Nova-3 as its replacement.
|
|
766
779
|
|
|
767
780
|
## Voice chat
|
|
768
781
|
|
|
@@ -813,7 +826,7 @@ This is a Cloudflare-proxied (third-party) model, so it requires Unified Billing
|
|
|
813
826
|
|
|
814
827
|
## Image generation
|
|
815
828
|
|
|
816
|
-
**
|
|
829
|
+
**23** image models in `src/models.ts` (or `GET /api/models?type=image`): Google Nano Banana Pro / 2 / 2.1 / 2 Lite, Imagen 4, GPT Image 1.5 / 2, Recraft V4 / V4.1 / V4.1 Pro / V4.1 Flash, xAI Grok Imagine Image (+ Quality, 2.0), ByteDance Seedream 5.5 / 5 Pro / 5 Lite, FLUX 2 Klein 9B/4B, FLUX 2 Dev, FLUX-1 schnell, Lucid Origin, Phoenix 1.0. The six FLUX/Leonardo models run through Workers AI (no Unified Billing required); the rest are proxied partner models on Unified Billing (need CF credits). GPT Image 1.5 / 2 are opaque on the proxy by default; **optional deployer BYOK (v0.174.0):** set `OPENAI_API_KEY` for transparent PNG via `api.openai.com` (ignored in public mode, v1.0.5).
|
|
817
830
|
|
|
818
831
|
### Google Nano Banana Pro (Unified Billing, v0.21.2)
|
|
819
832
|
|
|
@@ -840,14 +853,14 @@ Proxied image models return a URL and/or inline base64 in the `{ state, result }
|
|
|
840
853
|
|
|
841
854
|
The three FLUX-2 models (Klein 9B, Klein 4B, Dev) accept up to 4 reference images for image-to-image generation. When you select a FLUX-2 model in the image-gen UI, an attach row appears alongside the prompt and negative-prompt fields. Pick up to 4 images; each is downscaled client-side to 512px max dimension (per the model spec) and sent as `input_image_0` through `input_image_3` multipart form fields.
|
|
842
855
|
|
|
843
|
-
FLUX-1 schnell, Lucid Origin, Phoenix 1.0
|
|
856
|
+
FLUX-1 schnell, Lucid Origin, and Phoenix 1.0 are text-to-image only; no reference image input.
|
|
844
857
|
|
|
845
858
|
### Gateway routing quirks
|
|
846
859
|
|
|
847
860
|
As of 2026-Q1, three Workers AI image-gen models have transport-layer incompatibilities with the AI Gateway:
|
|
848
861
|
|
|
849
862
|
- **FLUX-2 family** requires multipart-form input. Gateway can't proxy stream input.
|
|
850
|
-
- **Phoenix 1.0**
|
|
863
|
+
- **Phoenix 1.0** returns ReadableStream output. Gateway can't proxy stream output.
|
|
851
864
|
|
|
852
865
|
The worker detects these models and bypasses the gateway, calling `env.AI.run` directly. Cost: no AI Gateway observability/caching for these specific models (the persisted row's `ai_gateway_log_id` stays null). FLUX-1 schnell and Lucid Origin work through the gateway normally.
|
|
853
866
|
|
|
@@ -952,7 +965,7 @@ Per-turn opt-in: the toggle is not sticky across turns. Each turn decides indepe
|
|
|
952
965
|
|
|
953
966
|
### Setup
|
|
954
967
|
|
|
955
|
-
|
|
968
|
+
Uncomment the service binding in your `wrangler.toml` (it ships commented out in `wrangler.example.toml`) and redeploy. Wikipedia needs no config.
|
|
956
969
|
|
|
957
970
|
```toml
|
|
958
971
|
[[services]]
|
|
@@ -961,7 +974,7 @@ service = "skyphusion-search"
|
|
|
961
974
|
entrypoint = "SearchEntrypoint"
|
|
962
975
|
```
|
|
963
976
|
|
|
964
|
-
The binding calls the named entrypoint, not `POST /ask`. There is no Origin header and no Turnstile token. The search worker's script must export `SearchEntrypoint` (search-mcp).
|
|
977
|
+
The binding calls the named entrypoint, not `POST /ask`. There is no Origin header and no Turnstile token. The search worker's script must export `SearchEntrypoint` (search-mcp). Keep the `[[services]]` block commented out if that worker is not on your account.
|
|
965
978
|
|
|
966
979
|
### Caveats worth knowing
|
|
967
980
|
|
package/template/package.json
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"db:migrate:remote": "wrangler d1 execute skyphusion-llm --remote --file=schema.sql"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"unpdf": "^2.1
|
|
20
|
+
"unpdf": "^2.2.1",
|
|
21
21
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@cloudflare/vitest-pool-workers": "^0.23.0",
|
|
25
|
-
"@cloudflare/workers-types": "^5.
|
|
25
|
+
"@cloudflare/workers-types": "^5.20261121.1",
|
|
26
26
|
"@types/node": "^26.6.6",
|
|
27
27
|
"@vitest/coverage-v8": "^4.1.12",
|
|
28
28
|
"typescript": "^7.0.2",
|
|
29
29
|
"vitest": "^4.1.8",
|
|
30
|
-
"wrangler": "^4.
|
|
30
|
+
"wrangler": "^4.166.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -50,6 +50,8 @@ function imageToVideoParams(
|
|
|
50
50
|
case "bytedance/seedance-2.0":
|
|
51
51
|
case "bytedance/seedance-2.0-fast":
|
|
52
52
|
case "bytedance/seedance-2.0-mini":
|
|
53
|
+
// 2026-12 refresh: seedance-2.5 lists the same i2v fields on its CF model page.
|
|
54
|
+
case "bytedance/seedance-2.5":
|
|
53
55
|
return {
|
|
54
56
|
image: imageUrl,
|
|
55
57
|
prompt: motion,
|
package/template/src/models.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Model catalog
|
|
1
|
+
// Model catalog.
|
|
2
2
|
//
|
|
3
3
|
// Extracted from src/index.ts for navigability. This file is the single
|
|
4
4
|
// authoritative list of models the worker exposes; adding or removing
|
|
@@ -37,7 +37,22 @@ export type Provider =
|
|
|
37
37
|
| "pixverse"
|
|
38
38
|
| "vidu"
|
|
39
39
|
| "recraft"
|
|
40
|
-
| "moonshotai"
|
|
40
|
+
| "moonshotai"
|
|
41
|
+
| "deepseek";
|
|
42
|
+
|
|
43
|
+
// 2026-12 refresh: third-party Unified Billing chat providers whose Cloudflare catalog
|
|
44
|
+
// request format is Chat Completions ({ messages } in, OpenAI-compatible SSE
|
|
45
|
+
// out). They share one dispatch path: env.AI.run with { messages } for
|
|
46
|
+
// POST /api/chat, and callOpenAIStream for POST /api/chat/stream. A provider
|
|
47
|
+
// here must list "Chat Completions" under "Request formats" on its CF model
|
|
48
|
+
// page. alibaba and minimax also carry video/music entries; this set only
|
|
49
|
+
// governs type "chat".
|
|
50
|
+
export const OPENAI_COMPAT_CHAT_PROVIDERS: ReadonlySet<Provider> = new Set<Provider>([
|
|
51
|
+
"moonshotai",
|
|
52
|
+
"alibaba",
|
|
53
|
+
"deepseek",
|
|
54
|
+
"minimax",
|
|
55
|
+
]);
|
|
41
56
|
|
|
42
57
|
export interface ModelEntry {
|
|
43
58
|
id: string;
|
|
@@ -74,6 +89,14 @@ export const MODELS: ModelEntry[] = [
|
|
|
74
89
|
// catalog surface; the legacy AI Gateway anthropic allowlist is frozen and
|
|
75
90
|
// forwards this id keyless (provider 401, surfaced as a 502). The binding
|
|
76
91
|
// path injects credentials. Dispatch lives in src/providers/anthropic.ts.
|
|
92
|
+
// 2026-12 catalog refresh: Claude 5.x family. New CF Unified Billing ids use
|
|
93
|
+
// the dotted CF form (anthropic/claude-opus-5.5), so they need binding: true
|
|
94
|
+
// (the binding path passes the full CF id; the legacy path strips the prefix
|
|
95
|
+
// and sends Anthropic's native name).
|
|
96
|
+
{ id: "anthropic/claude-fable-5.2", label: "Claude Fable 5.2 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
|
|
97
|
+
{ id: "anthropic/claude-opus-5.5", label: "Claude Opus 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
|
|
98
|
+
{ id: "anthropic/claude-sonnet-5.5", label: "Claude Sonnet 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
|
|
99
|
+
{ id: "anthropic/claude-haiku-5.5", label: "Claude Haiku 5.5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
|
|
77
100
|
{ id: "anthropic/claude-fable-5", label: "Claude Fable 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true, binding: true },
|
|
78
101
|
{ id: "anthropic/claude-sonnet-5", label: "Claude Sonnet 5 (Anthropic)", group: "Chat \u00b7 Anthropic", type: "chat", capabilities: ["vision"], provider: "anthropic", streaming: true },
|
|
79
102
|
// v0.170.0: Claude Opus 5 (near-Fable intelligence, lower price). New CF
|
|
@@ -89,6 +112,8 @@ export const MODELS: ModelEntry[] = [
|
|
|
89
112
|
// v0.170.0: grok-4.5 re-added via env.AI.run binding (binding: true). CF docs
|
|
90
113
|
// now list it on the Unified Billing catalog with working env.AI.run examples;
|
|
91
114
|
// legacy gateway allowlist remains frozen for new ids.
|
|
115
|
+
// 2026-12 refresh: grok-4.7 (Chat Completions on the CF catalog); binding path, as grok-4.5.
|
|
116
|
+
{ id: "xai/grok-4.7", label: "Grok 4.7 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true },
|
|
92
117
|
{ id: "xai/grok-4.5", label: "Grok 4.5 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true, binding: true },
|
|
93
118
|
{ id: "xai/grok-4.3", label: "Grok 4.3 (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true },
|
|
94
119
|
{ id: "xai/grok-4.20-multi-agent-0309", label: "Grok 4.20 Multi-Agent (xAI)", group: "Chat \u00b7 xAI", type: "chat", capabilities: ["vision"], provider: "xai", streaming: true },
|
|
@@ -104,8 +129,18 @@ export const MODELS: ModelEntry[] = [
|
|
|
104
129
|
// OpenAI-compatible SSE path (callOpenAIStream). Vision claimed upstream;
|
|
105
130
|
// multimodal-in through the proxy is unsmoked, so caps stay empty like OpenAI.
|
|
106
131
|
{ id: "moonshotai/kimi-k3", label: "Kimi K3 (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true },
|
|
107
|
-
{ id: "
|
|
108
|
-
|
|
132
|
+
{ id: "moonshotai/kimi-k3.1-pro", label: "Kimi K3.1 Pro (Moonshot, 1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "moonshotai", streaming: true },
|
|
133
|
+
// 2026-12 refresh: more Chat Completions providers on OPENAI_COMPAT_CHAT_PROVIDERS.
|
|
134
|
+
// Caps stay empty: multimodal-in through the proxy is unsmoked (K3 convention).
|
|
135
|
+
{ id: "alibaba/qwen3.8-max", label: "Qwen 3.8 Max (Alibaba)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "alibaba", streaming: true },
|
|
136
|
+
{ id: "deepseek/deepseek-v4-pro", label: "DeepSeek V4 Pro (DeepSeek)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "deepseek", streaming: true },
|
|
137
|
+
{ id: "minimax/m3", label: "MiniMax M3 (1M ctx)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], provider: "minimax", streaming: true },
|
|
138
|
+
// 2026-12 refresh: Workers AI replacements CF recommends for the models it retired on
|
|
139
|
+
// 2026-11-20 (HTTP 410, error 5028): deepseek-v4.1-flash and glm-5.3 for
|
|
140
|
+
// frontier needs, qwen3.8-27b (and gemma-4, below) for smaller needs.
|
|
141
|
+
{ id: "@cf/deepseek-ai/deepseek-v4.1-flash-1017", label: "DeepSeek V4.1 Flash (1M ctx, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
|
|
142
|
+
{ id: "@cf/zai-org/glm-5.3", label: "GLM-5.3 (Z.AI, agentic coding)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true },
|
|
143
|
+
{ id: "@cf/thinkingmachines/inkling-2-small", label: "Inkling 2 Small (Thinking Machines, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
|
|
109
144
|
{ id: "@cf/openai/gpt-oss-120b", label: "GPT-OSS 120B (reasoning)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: [], streaming: true },
|
|
110
145
|
{ id: "@cf/meta/llama-4-scout-17b-16e-instruct", label: "Llama 4 Scout (MoE, vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
|
|
111
146
|
{ id: "@cf/google/gemma-4-26b-a4b-it", label: "Gemma 4 26B (vision)", group: "Chat \u00b7 Frontier", type: "chat", capabilities: ["vision"], streaming: true },
|
|
@@ -121,6 +156,12 @@ export const MODELS: ModelEntry[] = [
|
|
|
121
156
|
// capabilities is empty: multimodal-in through the proxied binding is
|
|
122
157
|
// unverified, so the attach affordance stays off.
|
|
123
158
|
{ id: "openai/gpt-5.5", label: "GPT-5.5 (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
|
|
159
|
+
// 2026-12 refresh: GPT-6 generation. The CF pages list Chat Completions and Responses,
|
|
160
|
+
// so the default Chat Completions path applies (no api flag).
|
|
161
|
+
{ id: "openai/gpt-6.2-astra", label: "GPT-6.2 Astra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
|
|
162
|
+
{ id: "openai/gpt-6.2-sol", label: "GPT-6.2 Sol (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
|
|
163
|
+
{ id: "openai/gpt-6.1-terra", label: "GPT-6.1 Terra (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
|
|
164
|
+
{ id: "openai/gpt-6-luna", label: "GPT-6 Luna (OpenAI)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true },
|
|
124
165
|
// v0.173.0: Responses API only (not Chat Completions). Flagged api:"responses".
|
|
125
166
|
{ id: "openai/gpt-5.5-pro", label: "GPT-5.5 Pro (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
|
|
126
167
|
{ id: "openai/gpt-5.6-sol", label: "GPT-5.6 Sol (OpenAI, Responses)", group: "Chat \u00b7 OpenAI", type: "chat", capabilities: [], provider: "openai", streaming: true, api: "responses" },
|
|
@@ -132,17 +173,12 @@ export const MODELS: ModelEntry[] = [
|
|
|
132
173
|
// Meta
|
|
133
174
|
{ id: "@cf/meta/llama-3.3-70b-instruct-fp8-fast", label: "Llama 3.3 70B (fp8)", group: "Chat \u00b7 Meta", type: "chat", capabilities: [], streaming: true },
|
|
134
175
|
{ id: "@cf/meta/llama-3.2-11b-vision-instruct", label: "Llama 3.2 11B (vision)", group: "Chat \u00b7 Meta", type: "chat", capabilities: ["vision"], streaming: true },
|
|
135
|
-
{ id: "@cf/meta/llama-3.2-3b-instruct", label: "Llama 3.2 3B", group: "Chat \u00b7 Meta", type: "chat", capabilities: [], streaming: true },
|
|
136
176
|
// Qwen
|
|
137
|
-
{ id: "@cf/qwen/qwen3-30b-a3b-fp8", label: "Qwen3 30B MoE", group: "Chat \u00b7 Qwen", type: "chat", capabilities: [], streaming: true },
|
|
138
|
-
{ id: "@cf/qwen/qwq-32b", label: "QwQ 32B (reasoning)", group: "Chat \u00b7 Qwen", type: "chat", capabilities: [], streaming: true },
|
|
139
177
|
{ id: "@cf/qwen/qwen2.5-coder-32b-instruct", label: "Qwen2.5 Coder 32B", group: "Chat \u00b7 Qwen", type: "chat", capabilities: [], streaming: true },
|
|
178
|
+
{ id: "@cf/qwen/qwen3.8-27b", label: "Qwen 3.8 27B (vision)", group: "Chat \u00b7 Qwen", type: "chat", capabilities: ["vision"], streaming: true },
|
|
140
179
|
// Other
|
|
141
|
-
{ id: "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", label: "DeepSeek R1 32B", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
142
180
|
{ id: "@cf/mistralai/mistral-small-3.1-24b-instruct", label: "Mistral Small 3.1 (vision)", group: "Chat \u00b7 Other", type: "chat", capabilities: ["vision"], streaming: true },
|
|
143
181
|
{ id: "@cf/zai-org/glm-4.7-flash", label: "GLM-4.7 Flash (Z.AI, 100+ lang)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
144
|
-
{ id: "@cf/zai-org/glm-5.2", label: "GLM-5.2 (Z.AI, agentic coding)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
145
|
-
{ id: "@cf/nvidia/nemotron-3-120b-a12b", label: "Nemotron 3 120B (NVIDIA, agentic)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
146
182
|
{ id: "@cf/aisingapore/gemma-sea-lion-v4-27b-it", label: "SEA-LION v4 27B (SE Asian langs)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
147
183
|
// Gemini proxied via Unified Billing (v0.21.3; streaming v0.21.4). NOT
|
|
148
184
|
// OpenAI-shaped: native contents/candidates format, transformed by
|
|
@@ -153,12 +189,18 @@ export const MODELS: ModelEntry[] = [
|
|
|
153
189
|
{ id: "google/gemini-3.5-flash", label: "Gemini 3.5 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
154
190
|
// v0.170.0: newer Flash tier; same Generate Content / google dispatcher path.
|
|
155
191
|
{ id: "google/gemini-3.6-flash", label: "Gemini 3.6 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
192
|
+
// 2026-12 refresh: same native contents/candidates shape as 3.6 (verified on the CF
|
|
193
|
+
// model pages), so the google dispatcher covers them.
|
|
194
|
+
{ id: "google/gemini-3.8-flash", label: "Gemini 3.8 Flash (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
195
|
+
{ id: "google/gemini-4-argon", label: "Gemini 4 Argon (Google, frontier)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
196
|
+
{ id: "google/gemini-4-carbon", label: "Gemini 4 Carbon (Google, reasoning)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
197
|
+
{ id: "google/gemini-4-neon", label: "Gemini 4 Neon (Google)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
198
|
+
{ id: "google/gemini-4-hydrogen", label: "Gemini 4 Hydrogen (Google, fast)", group: "Chat \u00b7 Google", type: "chat", capabilities: [], provider: "google", streaming: true },
|
|
156
199
|
// @cf/google/gemma-3-12b-it removed v0.165.0: marked Deprecated on the
|
|
157
200
|
// Workers AI model list; gemma-4-26b-a4b-it (above) is the current Gemma.
|
|
158
201
|
{ id: "@cf/ibm-granite/granite-4.0-h-micro", label: "Granite 4.0 Micro (IBM)", group: "Chat \u00b7 Other", type: "chat", capabilities: [], streaming: true },
|
|
159
202
|
// @hf/nousresearch/hermes-2-pro-mistral-7b removed v0.165.0: marked
|
|
160
203
|
// Deprecated (and Beta) on the Workers AI model list.
|
|
161
|
-
{ id: "@cf/meta/llama-3.2-1b-instruct", label: "Llama 3.2 1B (tiny, cheap)", group: "Chat \u00b7 Meta", type: "chat", capabilities: [], streaming: true },
|
|
162
204
|
|
|
163
205
|
// ---- Image generation ----
|
|
164
206
|
// Google proxied (Unified Billing): URL-returning, different schema from the
|
|
@@ -169,6 +211,8 @@ export const MODELS: ModelEntry[] = [
|
|
|
169
211
|
{ id: "google/nano-banana-2", label: "Nano Banana 2 (Google)", group: "Image Gen", type: "image", capabilities: [], provider: "google" },
|
|
170
212
|
// v0.172.0: fast/cheap Nano Banana sibling; same google proxied image path.
|
|
171
213
|
{ id: "google/nano-banana-2-lite", label: "Nano Banana 2 Lite (Google)", group: "Image Gen", type: "image", capabilities: [], provider: "google" },
|
|
214
|
+
// 2026-12 refresh: same { prompt, output_format: "png" } schema; google image path.
|
|
215
|
+
{ id: "google/nano-banana-2.1", label: "Nano Banana 2.1 (Google)", group: "Image Gen", type: "image", capabilities: [], provider: "google" },
|
|
172
216
|
{ id: "google/imagen-4", label: "Imagen 4 (Google)", group: "Image Gen", type: "image", capabilities: [], provider: "google" },
|
|
173
217
|
// gpt-image-1.5 (v0.22.0). Opaque on CF proxy by default ({ prompt, quality,
|
|
174
218
|
// size }; proxy 7003-rejects background/output_format). Optional OPENAI_API_KEY
|
|
@@ -183,28 +227,31 @@ export const MODELS: ModelEntry[] = [
|
|
|
183
227
|
// v0.172.0: standard-res V4.1 (pro is 2048px+); same recraft dispatcher.
|
|
184
228
|
{ id: "recraft/recraftv4-1", label: "Recraft V4.1 (art-directed, opaque)", group: "Image Gen", type: "image", capabilities: [], provider: "recraft" },
|
|
185
229
|
{ id: "recraft/recraftv4-1-pro", label: "Recraft V4.1 Pro (art-directed, opaque)", group: "Image Gen", type: "image", capabilities: [], provider: "recraft" },
|
|
230
|
+
// 2026-12 refresh: fast/cheap V4.1 raster; bare { prompt }, recraft path.
|
|
231
|
+
{ id: "recraft/recraftv4-1-flash", label: "Recraft V4.1 Flash (fast, opaque)", group: "Image Gen", type: "image", capabilities: [], provider: "recraft" },
|
|
186
232
|
// v0.171.0: xAI / ByteDance image via buildProxiedImageParams +
|
|
187
233
|
// extractProxiedImageAsset. Seedream: result.images[]; Grok Imagine:
|
|
188
234
|
// b64_json (ZDR) or URL, normalized by extractProxiedImageAsset.
|
|
189
235
|
{ id: "xai/grok-imagine-image", label: "Grok Imagine Image (xAI)", group: "Image Gen", type: "image", capabilities: [], provider: "xai" },
|
|
190
236
|
// v0.172.0: higher-fidelity Grok Imagine sibling; same xai image path.
|
|
191
237
|
{ id: "xai/grok-imagine-image-quality", label: "Grok Imagine Image Quality (xAI)", group: "Image Gen", type: "image", capabilities: [], provider: "xai" },
|
|
238
|
+
// 2026-12 refresh: accepts response_format b64_json, as its siblings; xai image path.
|
|
239
|
+
{ id: "xai/grok-imagine-image-2.0", label: "Grok Imagine Image 2.0 (xAI)", group: "Image Gen", type: "image", capabilities: [], provider: "xai" },
|
|
192
240
|
{ id: "bytedance/seedream-5-pro", label: "Seedream 5 Pro (ByteDance)", group: "Image Gen", type: "image", capabilities: [], provider: "bytedance" },
|
|
193
241
|
// v0.172.0: lighter/faster Seedream; same bytedance image path (images[]).
|
|
194
242
|
{ id: "bytedance/seedream-5-lite", label: "Seedream 5 Lite (ByteDance)", group: "Image Gen", type: "image", capabilities: [], provider: "bytedance" },
|
|
243
|
+
// 2026-12 refresh: same bare { prompt } shape; bytedance image path.
|
|
244
|
+
{ id: "bytedance/seedream-5.5", label: "Seedream 5.5 (ByteDance)", group: "Image Gen", type: "image", capabilities: [], provider: "bytedance" },
|
|
195
245
|
{ id: "@cf/black-forest-labs/flux-2-klein-9b", label: "FLUX 2 Klein 9B (frontier)", group: "Image Gen", type: "image", capabilities: [] },
|
|
196
246
|
{ id: "@cf/black-forest-labs/flux-2-klein-4b", label: "FLUX 2 Klein 4B (faster)", group: "Image Gen", type: "image", capabilities: [] },
|
|
197
247
|
{ id: "@cf/black-forest-labs/flux-2-dev", label: "FLUX 2 Dev (multi-reference)", group: "Image Gen", type: "image", capabilities: [] },
|
|
198
248
|
{ id: "@cf/black-forest-labs/flux-1-schnell", label: "FLUX-1 schnell (fast)", group: "Image Gen", type: "image", capabilities: [] },
|
|
199
249
|
{ id: "@cf/leonardo/lucid-origin", label: "Lucid Origin (Leonardo)", group: "Image Gen", type: "image", capabilities: [] },
|
|
200
250
|
{ id: "@cf/leonardo/phoenix-1.0", label: "Phoenix 1.0 (Leonardo)", group: "Image Gen", type: "image", capabilities: [] },
|
|
201
|
-
{ id: "@cf/lykon/dreamshaper-8-lcm", label: "Dreamshaper 8 LCM (fast SD)", group: "Image Gen", type: "image", capabilities: [] },
|
|
202
|
-
{ id: "@cf/stabilityai/stable-diffusion-xl-base-1.0", label: "Stable Diffusion XL (SDXL)", group: "Image Gen", type: "image", capabilities: [] },
|
|
203
251
|
|
|
204
252
|
// ---- Text-to-speech ----
|
|
205
253
|
{ id: "@cf/deepgram/aura-2-en", label: "Aura-2 English (Deepgram)", group: "TTS", type: "tts", capabilities: [] },
|
|
206
254
|
{ id: "@cf/deepgram/aura-2-es", label: "Aura-2 Spanish (Deepgram)", group: "TTS", type: "tts", capabilities: [] },
|
|
207
|
-
{ id: "@cf/myshell-ai/melotts", label: "MeloTTS (multilingual)", group: "TTS", type: "tts", capabilities: [] },
|
|
208
255
|
|
|
209
256
|
// ---- Speech-to-text ----
|
|
210
257
|
// Attach an audio file, pick a model, get the transcript. Audio file is
|
|
@@ -212,7 +259,6 @@ export const MODELS: ModelEntry[] = [
|
|
|
212
259
|
// Deepgram have different input/output contracts; runStt adapts per model.
|
|
213
260
|
{ id: "@cf/openai/whisper-large-v3-turbo", label: "Whisper Large v3 Turbo (best)", group: "Speech-to-text", type: "stt", capabilities: [] },
|
|
214
261
|
{ id: "@cf/openai/whisper", label: "Whisper (general purpose)", group: "Speech-to-text", type: "stt", capabilities: [] },
|
|
215
|
-
{ id: "@cf/openai/whisper-tiny-en", label: "Whisper Tiny EN (fast, beta)", group: "Speech-to-text", type: "stt", capabilities: [] },
|
|
216
262
|
{ id: "@cf/deepgram/nova-3", label: "Deepgram Nova-3 (accurate)", group: "Speech-to-text", type: "stt", capabilities: [] },
|
|
217
263
|
// @cf/deepgram/flux is websocket-only (error 8006 over the request/response
|
|
218
264
|
// binding), so it is NOT a one-shot "stt" model. It is a live "voice" session:
|
|
@@ -230,6 +276,9 @@ export const MODELS: ModelEntry[] = [
|
|
|
230
276
|
{ id: "google/veo-3.1-fast", label: "Veo 3.1 Fast (Google)", group: "Video Gen", type: "video", capabilities: [], provider: "google" },
|
|
231
277
|
// google/veo-3 and google/veo-3-fast: CF returns 7010 deprecated
|
|
232
278
|
// ("use google/veo-3.1-fast instead"); removed from catalog 2026-08-04.
|
|
279
|
+
// 2026-12 refresh: Seedance 2.5 shares the 2.0 i2v schema (image, integer duration,
|
|
280
|
+
// resolution, aspect_ratio, fps 24); see imageToVideoParams.
|
|
281
|
+
{ id: "bytedance/seedance-2.5", label: "Seedance 2.5 (ByteDance)", group: "Video Gen", type: "video", capabilities: ["image-input"], provider: "bytedance" },
|
|
233
282
|
{ id: "bytedance/seedance-2.0", label: "Seedance 2.0 (ByteDance)", group: "Video Gen", type: "video", capabilities: ["image-input"], provider: "bytedance" },
|
|
234
283
|
{ id: "bytedance/seedance-2.0-fast", label: "Seedance 2.0 Fast (ByteDance)", group: "Video Gen", type: "video", capabilities: ["image-input"], provider: "bytedance" },
|
|
235
284
|
// v0.170.0: compact/cost-efficient Seedance sibling; same t2v/i2v param shape.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// emit `input_tokens`/`output_tokens`. We accept both and prefer the OpenAI
|
|
11
11
|
// names when both are present.
|
|
12
12
|
//
|
|
13
|
-
// Reasoning models (gpt-oss-120b
|
|
13
|
+
// Reasoning models (for example gpt-oss-120b)
|
|
14
14
|
// emit `<think>...</think>` blocks inside `response`. The interpreter passes
|
|
15
15
|
// them through unchanged; the UI is responsible for folding them if desired.
|
|
16
16
|
|