Skip to content

Commit 65ec0dd

Browse files
authored
feat(providers): register the Morph Ultra plan preset (#8663)
* feat(providers): register the Morph Ultra plan preset * fix(providers): keep the Morph docs under the file-size cap and recount the Spanish locale * docs(providers): mirror the Morph preset in the Spanish guide * fix(providers): replay Morph reasoning_content and correct the abliterated billing claim
1 parent 624ce71 commit 65ec0dd

29 files changed

Lines changed: 488 additions & 23 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# 000 — morph_ultra_provider: Plan
2+
3+
## Objective
4+
5+
Register a new key provider preset `morph` for the Morph Ultra plan on the OpenAI Chat
6+
Completions wire, exposing only Ultra-plan models, with `morph-kimik31` (Kimi K3.1) and
7+
`morph-dsv41flash-1017` (DeepSeek V4.1 Flash, Oct 17 snapshot) as the enabled roster.
8+
9+
Evidence base (researched 2026-11-13, read-only, primary sources):
10+
- https://www.morphllm.com/products/ultra and https://docs.morphllm.com/ultra-plan — Ultra is
11+
$200/month, no token meter, and covers Kimi K3.1 (`morph-kimik31`), DeepSeek V4.1 Flash
12+
(`morph-dsv41flash`), its Oct 17 snapshot (`morph-dsv41flash-1017`), and
13+
`morph-dsv41flash-abliterated` only for accounts approved for privileged access.
14+
- https://docs.morphllm.com/sdk/components/fast-models — OpenAI-compatible base
15+
`https://api.morphllm.com/v1`, 1,048,576-token context, text+image input, tools,
16+
`response_format`, streaming, reasoning.
17+
- https://docs.morphllm.com/auth — `Authorization: Bearer <key>`.
18+
- https://docs.morphllm.com/api-reference/endpoint/models — `GET /v1/models` returns the
19+
OpenAI list shape with ids only.
20+
- Reasoning ladders: `morph-kimik31` accepts none/low/medium/high/xhigh/max;
21+
`morph-dsv41flash` and `-1017` accept none/low/high/xhigh/max (medium maps to high,
22+
minimal maps to low).
23+
24+
## Loop-spec
25+
26+
- Loop archetype: verifier-defined (typecheck + focused tests + structure/docs gates).
27+
- Write scope: `src/providers/registry/model-seeds.ts`,
28+
`src/providers/registry/entries-extended.ts`, `src/usage/expected-prices.ts`,
29+
`tests/providers/provider-registry-parity.test.ts`, new
30+
`tests/providers/morph-ultra-provider.test.ts`, `scripts/test-layout/layout.json`,
31+
`tests/fixtures/test-layout-expected.json`, `structure/providers-and-adapters.md`,
32+
`structure/ops/docs-and-release.md`, `docs-site/src/content/docs/**/guides/providers.md`,
33+
`docs-site/src/content/docs/**/getting-started/quickstart.md`.
34+
- Out of scope: the free-directory row (its base URL already matches), OAuth, Responses wire,
35+
GUI changes, any push/PR.
36+
- Budget: one work phase.
37+
38+
## Work-phase map
39+
40+
| WP | Doc | Slice | Depends on |
41+
|----|-----|-------|------------|
42+
| wp1 | 010_phase1.md | Registry entry + seeds + prices + tests + docs counts | — |
43+
44+
## Accept criteria
45+
46+
- `morph` resolves through `getProviderRegistryEntry` with base URL
47+
`https://api.morphllm.com/v1`, adapter `openai-chat`, authKind `key`, and exactly the two
48+
enabled Ultra models.
49+
- `bun run typecheck` exits 0.
50+
- Focused tests (parity, docs counts, new morph test, test-layout) pass.
51+
- `bun run structure:check` passes.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# 010 — Phase 1 (morph_ultra_provider)
2+
3+
## MODIFY / NEW / DELETE map
4+
5+
### MODIFY `src/providers/registry/model-seeds.ts`
6+
7+
Append after the StepFun seeds (end of file):
8+
9+
```ts
10+
// Morph Ultra plan (https://www.morphllm.com/products/ultra, verified 2026-11-13). The plan
11+
// removes the token meter on Kimi K3.1 and DeepSeek V4.1 Flash; every other Morph model bills
12+
// per token, so only Ultra rows are seeded. `morph-dsv41flash-abliterated` is Ultra-covered
13+
// only for accounts approved for privileged access (403 otherwise) and is therefore not seeded.
14+
export const MORPH_ULTRA_MODELS = ["morph-kimik31", "morph-dsv41flash-1017"];
15+
export const MORPH_ULTRA_CONTEXT_WINDOW = 1_048_576;
16+
export const MORPH_ULTRA_MODEL_CONTEXT_WINDOWS: Record<string, number> = Object.fromEntries(
17+
MORPH_ULTRA_MODELS.map(id => [id, MORPH_ULTRA_CONTEXT_WINDOW]),
18+
);
19+
export const MORPH_ULTRA_MODEL_INPUT_MODALITIES: Record<string, string[]> = Object.fromEntries(
20+
MORPH_ULTRA_MODELS.map(id => [id, ["text", "image"]]),
21+
);
22+
// Kimi K3.1 documents none/low/medium/high/xhigh/max; DeepSeek V4.1 Flash documents
23+
// none/low/high/xhigh/max and folds medium into high.
24+
export const MORPH_ULTRA_REASONING_EFFORTS: Record<string, string[]> = {
25+
"morph-kimik31": ["none", "low", "medium", "high", "xhigh", "max"],
26+
"morph-dsv41flash-1017": ["none", "low", "high", "xhigh", "max"],
27+
};
28+
export const MORPH_ULTRA_REASONING_EFFORT_MAPS: Record<string, Record<string, string>> = {
29+
"morph-dsv41flash-1017": { minimal: "low", medium: "high" },
30+
};
31+
```
32+
33+
### MODIFY `src/providers/registry/entries-extended.ts`
34+
35+
1. Add the five new names to the `model-seeds` import block (place them after
36+
`STEPFUN_REASONING_EFFORTS`).
37+
2. Insert a new entry between the `moonshot` entry and the `huggingface` entry:
38+
39+
```ts
40+
{
41+
// Morph Ultra plan (https://www.morphllm.com/products/ultra, verified 2026-11-13): one
42+
// subscription, no token meter, on Kimi K3.1 and DeepSeek V4.1 Flash. Only those Ultra rows
43+
// are seeded — every other Morph model bills per token, and the abliterated variant needs
44+
// privileged-access approval. Discovery stays off so the picker cannot re-add per-token rows.
45+
id: "morph", label: "Morph (Ultra plan)", baseUrl: "https://api.morphllm.com/v1",
46+
adapter: "openai-chat", authKind: "key",
47+
dashboardUrl: "https://www.morphllm.com/dashboard/api-keys",
48+
defaultModel: "morph-dsv41flash-1017",
49+
models: MORPH_ULTRA_MODELS,
50+
liveModels: false,
51+
modelContextWindows: MORPH_ULTRA_MODEL_CONTEXT_WINDOWS,
52+
modelInputModalities: MORPH_ULTRA_MODEL_INPUT_MODALITIES,
53+
modelReasoningEfforts: MORPH_ULTRA_REASONING_EFFORTS,
54+
modelReasoningEffortMap: MORPH_ULTRA_REASONING_EFFORT_MAPS,
55+
note: "...",
56+
},
57+
```
58+
59+
### MODIFY `src/usage/expected-prices.ts`
60+
61+
Add a `MORPH_ULTRA_PRICING` source constant and two `verified-derived` overlay rows
62+
(`morph/morph-kimik31` 2.50/14.00/0.29/0, `morph/morph-dsv41flash-1017` 0.12/0.80/0.008/0),
63+
noting the Ultra subscription bills no per-token rate and these are list-price estimates.
64+
65+
### MODIFY `tests/providers/provider-registry-parity.test.ts`
66+
67+
Add `"morph"` after `"moonshot"` in `EXPECTED_KEY_PROVIDER_IDS`.
68+
69+
### NEW `tests/providers/morph-ultra-provider.test.ts`
70+
71+
Cases: registry row shape; exactly the two Ultra models; 1M window and text+image; reasoning
72+
ladders and the DeepSeek medium->high map; discovery off; price overlays resolve; routing
73+
`morph/morph-kimik31` keeps the destination.
74+
75+
### MODIFY `scripts/test-layout/layout.json` and `tests/fixtures/test-layout-expected.json`
76+
77+
Register `morph-ultra-provider.test.ts` -> `providers`.
78+
79+
### MODIFY docs and structure
80+
81+
- `docs-site/src/content/docs/guides/providers.md`: 103 -> 104, 84 -> 85; add a Morph row to
82+
the endpoint table and a short Ultra paragraph.
83+
- The seven translated guides and eight quickstarts: same count bump.
84+
- `structure/ops/docs-and-release.md`: "103 total: 84 key-based" -> "104 total: 85 key-based".
85+
- `structure/providers-and-adapters.md`: note the Morph preset's Ultra-only roster.
86+
87+
## TESTS
88+
89+
`tests/providers/morph-ultra-provider.test.ts` (new), plus the existing parity and docs-count
90+
suites.
91+
92+
## Verification (C)
93+
94+
- `bun run typecheck` -> exit 0
95+
- `bun test tests/providers/morph-ultra-provider.test.ts tests/providers/provider-registry-parity.test.ts tests/ci-workflows/docs-provider-preset-counts.test.ts tests/test-layout.test.ts` -> exit 0
96+
- `bun run structure:check` -> exit 0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 020 — Verification evidence (morph_ultra_provider)
2+
3+
Recorded during B. The implementation itself landed before this cycle's B baseline was captured,
4+
so this doc carries the check evidence that B produced rather than a second source delta.
5+
6+
## What was verified
7+
8+
- `bun run typecheck` -> exit 0.
9+
- `bun run structure:check` -> exit 0 (structure/providers-and-adapters.md held at its 600-line budget).
10+
- Focused suites with the pinned runner
11+
(`OCX_TEST_RUNNER_BUN=/Users/jun/ocx-batch-bun/bun`): morph-ultra-provider (14), provider-registry-parity,
12+
docs-provider-preset-counts (18), test-layout, test-layout-tooling, file-size-ratchet,
13+
structure-ssot, usage-cost -> 274 pass, 0 fail.
14+
- Full `bun run test` -> 4 distinct failures, none in a file this change touches:
15+
- `release version line > the in-tree version is never behind a released one` — package.json is
16+
2.84.0 while the tag set reaches v2.100.2. Reproduced on an unmodified HEAD checkout.
17+
- `connected Desktop uses hub IDs across a cold restart (stored profile=false)` — model ordering
18+
differs from the expectation. Reproduced on an unmodified HEAD checkout.
19+
- `package tree integrity > ... the installed guard reads process.execPath as the runtime` and
20+
`live audio readiness ... cannot claim readiness` — 5s timeouts under the parallel suite; both
21+
pass standalone on this tree and on HEAD.
22+
23+
## Reviewer rounds
24+
25+
Round 1 (fail) found three blockers, all fixed and re-verified in round 2 (pass):
26+
1. `reasoning_effort: "none"` was dropped, which Morph reads as reasoning on. Fixed with identity
27+
map entries for both models plus adapter-body tests.
28+
2. Registering `morph` retargeted an existing custom provider of the same name. Fixed with
29+
`preserveCustomDestination: true` plus a routing regression.
30+
3. `scripts/test-layout/layout.json` reached the 2000-line threshold. Fixed; back to 1999.

‎docs-site/src/content/docs/es/getting-started/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ocx init
2323

2424
`ocx init` te guía por estos pasos:
2525

26-
1. **Elegir un proveedor**: selecciona uno de los 107 preajustes del registro integrado o `custom` para introducir una URL base y un adaptador.
26+
1. **Elegir un proveedor**: selecciona uno de los 108 preajustes del registro integrado o `custom` para introducir una URL base y un adaptador.
2727
2. **Clave API**: pega una clave o indica una variable de entorno como `${ANTHROPIC_API_KEY}`.
2828
3. **Modelo predeterminado**: para proveedores con clave, locales o personalizados, acepta el preajuste o introduce un identificador de modelo.
2929
4. **Puerto del proxy**: `10100` de forma predeterminada.

‎docs-site/src/content/docs/es/guides/providers.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ incluidas las vacías, no cambian. Esta reparación no requiere detección de mo
447447

448448
## 3. Catálogo de proveedores con clave API
449449

450-
opencodex incluye 107 preajustes integrados: 86 con clave, 17 OAuth, tres locales y uno predeterminado de reenvío a ChatGPT. El selector **Añadir proveedor** abre el formulario del proveedor con clave, valida la credencial y la guarda; cada proveedor tiene su propia validación. Entre ellos:
450+
opencodex incluye 108 preajustes integrados: 87 con clave, 17 OAuth, tres locales y uno predeterminado de reenvío a ChatGPT. El selector **Añadir proveedor** abre el formulario del proveedor con clave, valida la credencial y la guarda; cada proveedor tiene su propia validación. Entre ellos:
451451

452452
**ClinePass** utiliza una clave API de Cline con el [catálogo oficial de suscripción](https://docs.cline.bot/getting-started/clinepass) y el [punto final de Chat Completions](https://docs.cline.bot/api/chat-completions), operados por Cline Bot Inc. bajo [los términos de Cline](https://cline.bot/tos). Un id enrutado como `cline-pass/cline-pass/kimi-k3` es intencional: el primer segmento selecciona el proveedor de opencodex, mientras que `cline-pass/kimi-k3` es el identificador de modelo completo que se envía aguas arriba. La cuota de ClinePass se comparte por cuenta entre límites rotativos de 5 horas, semanales y mensuales. Una sonda en vivo del 2026-08-13 verificó que todos los modelos estáticos de ClinePass aceptan `low`, `medium`, `high`, `xhigh` y `max` en el límite de entrada de la pasarela. opencodex conserva los niveles solicitados; cualquier normalización específica del backend sigue siendo responsabilidad de ClinePass.
453453

@@ -495,6 +495,7 @@ opencodex incluye 107 preajustes integrados: 86 con clave, 17 OAuth, tres locale
495495
| Together | `https://api.together.xyz/v1` |
496496
| Fireworks | `https://api.fireworks.ai/inference/v1` |
497497
| Moonshot (Kimi API) · Kimi (coding) | `https://api.moonshot.ai/v1` · `https://api.kimi.com/coding/v1` |
498+
| Morph (Ultra plan) | `https://api.morphllm.com/v1` |
498499
| Hugging Face | `https://router.huggingface.co/v1` |
499500
| NVIDIA NIM | `https://integrate.api.nvidia.com/v1` |
500501
| Z.AI (GLM Coding) | `https://api.z.ai` — Responses en `/api/v1/responses` de forma predeterminada; Chat Completions en `/api/coding/paas/v4/chat/completions` por modelo mediante `modelAdapters` |
@@ -521,6 +522,9 @@ opencodex incluye 107 preajustes integrados: 86 con clave, 17 OAuth, tres locale
521522

522523
Ambos presets incluyen `deepseek-v4.1-flash-1017`, con entrada de texto e imágenes, salida de texto, contexto de 1.000.000 de tokens y razonamiento `low`, `high` y `max` (`high` por defecto). Su límite de salida de 393.216 sigue la normalización del presupuesto publicado; no es un límite medido. El Lab informa 384.000. Los esquemas estrictos son rechazados y `json_object` no está verificado para este identificador exacto, por lo que las solicitudes Chat omiten `response_format`: la salida es texto de mejor esfuerzo, sin garantía de JSON. La degradación JSON verificada del modelo sin sufijo y las asignaciones existentes a Responses no cambian. Beijing también incluye `deepseek-v4-pro-0813`, ahora publicado. La región internacional omite los retirados `deepseek-v3.2` y `deepseek-v4-flash` sin sufijo, pero conserva `deepseek-v4-flash-0731`. Los presets mantienen los hosts de sus guías oficiales: Beijing usa `https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1` y la región internacional `https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1`. El preset Qwen Cloud usa el host Token Plan independiente documentado arriba. Consulta la [ficha del modelo 1017](https://www.qianwenai.com/models/deepseek-v4.1-flash-1017), la [referencia Chat](https://docs.qwencloud.com/api-reference/chat/openai-chat) y la [guía Personal](https://help.aliyun.com/en/model-studio/token-plan-personal-overview).
523524

525+
**Morph (Ultra plan)** sirve `https://api.morphllm.com/v1` y siembra solo los modelos cubiertos por Ultra, `morph-kimik31` (Kimi K3.1) y `morph-dsv41flash-1017` (DeepSeek V4.1 Flash, instantánea del 17 de octubre): cualquier otro modelo de Morph se factura por token, y `morph-dsv41flash-abliterated` está cubierto por Ultra solo para cuentas con aprobación de acceso privilegiado.
526+
Ambos publican una ventana de 1.048.576 tokens, aceptan texto e imágenes y admiten herramientas, streaming y razonamiento; Kimi acepta `none`..`max` y DeepSeek Flash `none`/`low`/`high`/`xhigh`/`max` con `medium` asignado a `high`.
527+
Ultra elimina el medidor de tokens pero no los límites por minuto, así que un `429` significa reintentar tras `Retry-After`. Cree una clave en el [panel de Morph](https://www.morphllm.com/dashboard/api-keys) y luego ejecute `ocx provider add morph`; el descubrimiento en vivo permanece desactivado porque `GET /v1/models` también lista modelos por token que el plan excluye.
524528
**OpenGateway** es una pasarela compatible con OpenAI operada por Sionic AI en
525529
`https://apis.opengateway.ai/v1`. Su catálogo público contiene unos 80 modelos activos (verificado el 2026-10-02); el preajuste actualiza automáticamente la lista de modelos en vivo desde el `GET /v1/models` público y conserva los modelos Chat Completions activos (además de `openai/o3-pro`, exclusivo de Responses y anclado a Responses). Los modelos `deepseek/deepseek-v4.1-flash-ultrafast` y `z-ai/glm-5.3-flash-ultrafast` servidos por Sionic aparecen primero. Cree una clave en el [panel de OpenGateway](https://opengateway.ai/api-keys) y luego ejecute
526530
`ocx provider add opengateway` o seleccione **OpenGateway** en el panel. Las solicitudes de chat usan la clave Bearer configurada; la lista pública de modelos no valida esa clave.

‎docs-site/src/content/docs/fr/getting-started/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ocx init
1313

1414
`ocx init` vous accompagne dans les étapes suivantes :
1515

16-
1. **Choix d’un fournisseur** — sélectionnez l’un des 107 préréglages intégrés au registre, ou `custom` pour saisir une
16+
1. **Choix d’un fournisseur** — sélectionnez l’un des 108 préréglages intégrés au registre, ou `custom` pour saisir une
1717
URL de base et un adaptateur.
1818
2. **Clé API** — collez une clé ou référencez une variable d’environnement telle que `${ANTHROPIC_API_KEY}`.
1919
3. **Modèle par défaut** — pour les fournisseurs clés, locaux et personnalisés, acceptez le préréglage ou saisissez un identifiant de modèle.

‎docs-site/src/content/docs/fr/guides/providers.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ existante n'est pas concernée.
310310

311311
## 3. Catalogue des clés API
312312

313-
opencodex fournit 107 préréglages intégrés : 86 à clé, 17 OAuth, trois locaux et un préréglage par défaut de
313+
opencodex fournit 108 préréglages intégrés : 87 à clé, 17 OAuth, trois locaux et un préréglage par défaut de
314314
transfert ChatGPT. Dans le tableau de bord, le sélecteur **Ajouter un fournisseur** ouvre le tableau de bord du
315315
fournisseur à clé, valide la clé et l'enregistre ; la validation dépend du fournisseur. Parmi les entrées notables :
316316

‎docs-site/src/content/docs/getting-started/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ocx init
2121

2222
`ocx init` walks you through:
2323

24-
1. **Pick a provider** — choose one of the 107 built-in registry presets or `custom` to type a base
24+
1. **Pick a provider** — choose one of the 108 built-in registry presets or `custom` to type a base
2525
URL and adapter.
2626
2. **API key** — paste a key, or reference an environment variable like `${ANTHROPIC_API_KEY}`.
2727
3. **Default model** — for key, local, and custom providers, accept the preset or enter a model id.

‎docs-site/src/content/docs/guides/providers.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ On upgrade, startup adds Pro to a saved model list only when it exactly matches
781781

782782
## 3. API-key catalog
783783

784-
opencodex ships 107 built-in presets: 86 key-based, 17 OAuth, three local, and one default
784+
opencodex ships 108 built-in presets: 87 key-based, 17 OAuth, three local, and one default
785785
ChatGPT-forward preset. The dashboard's **Add provider** picker opens a key provider's dashboard,
786786
validates the key, and stores it; validation is provider-specific. Notable entries:
787787

@@ -857,6 +857,7 @@ region-pinned EU routes, is at [opper.ai/models](https://opper.ai/models). Opper
857857
| Together | `https://api.together.xyz/v1` |
858858
| Fireworks | `https://api.fireworks.ai/inference/v1` |
859859
| Moonshot (Kimi API) · Kimi (coding) | `https://api.moonshot.ai/v1` · `https://api.kimi.com/coding/v1` |
860+
| Morph (Ultra plan) | `https://api.morphllm.com/v1` |
860861
| Hugging Face | `https://router.huggingface.co/v1` |
861862
| NVIDIA NIM | `https://integrate.api.nvidia.com/v1` |
862863
| Z.AI (GLM Coding) | `https://api.z.ai` — Responses at `/api/v1/responses` by default; Chat Completions at `/api/coding/paas/v4/chat/completions` per model through `modelAdapters` |
@@ -899,7 +900,9 @@ The Qwen Cloud preset uses the separate Token Plan host that Qwen Cloud document
899900
See the [1017 model card](https://www.qianwenai.com/models/deepseek-v4.1-flash-1017),
900901
[Chat reference](https://docs.qwencloud.com/api-reference/chat/openai-chat) and
901902
[Personal overview](https://help.aliyun.com/en/model-studio/token-plan-personal-overview).
902-
903+
**Morph (Ultra plan)** serves `https://api.morphllm.com/v1` and seeds only the Ultra-covered models, `morph-kimik31` (Kimi K3.1) and `morph-dsv41flash-1017` (DeepSeek V4.1 Flash, October 17 snapshot): every other Morph model bills per token, and `morph-dsv41flash-abliterated` is Ultra-covered only for accounts approved for privileged access.
904+
Both publish a 1,048,576-token window, accept text and images, and support tools, streaming and reasoning; Kimi takes `none`..`max` and DeepSeek Flash `none`/`low`/`high`/`xhigh`/`max` with `medium` folded onto `high`.
905+
Ultra removes the token meter but not the per-minute limits, so a `429` means retry after `Retry-After`. Create a key in the [Morph dashboard](https://www.morphllm.com/dashboard/api-keys), then run `ocx provider add morph`; live discovery stays off because `GET /v1/models` also lists per-token models the plan excludes.
903906
**OpenGateway** is an OpenAI-compatible gateway operated by Sionic AI at
904907
`https://apis.opengateway.ai/v1`. Its public catalog contains about 80 active models
905908
(as verified on 2026-10-02); the preset automatically refreshes the live model list from

0 commit comments

Comments
 (0)