Skip to content

feat(zenifra): add hosted model catalog - #6970

Open
ramonpaolo wants to merge 9 commits into
anomalyco:devfrom
ramonpaolo:feat/zenifra-hosted-models
Open

ramonpaolo wants to merge 9 commits into
anomalyco:devfrom
ramonpaolo:feat/zenifra-hosted-models

Conversation

@ramonpaolo

Copy link
Copy Markdown
Contributor

Summary

  • Add the 11 model routes currently hosted by Zenifra.
  • Replace the obsolete Zenifra Qwen3.6 route with Qwen3.8 27B and align its capabilities.
  • Convert Zenifra BRL prices to models.dev USD/MTok using the project rate R$5.20 = US$1.00.
  • Document the conversion rate and date, including the qwen3.7-plus context tier.

Validation

  • bun validate passes.
  • git diff --check passes.
  • bun test: 318 passed, 6 pre-existing failures unrelated to this PR; no test files are changed.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/zenifra/models/deepseek-v4-pro.toml:5 - Check: Relay reasoning_options must follow the lab/same-surface peer baseline for the underlying model, not an invented effort enum. Why: First-party DeepSeek V4 Pro is toggle + high/max (providers/deepseek/models/deepseek-v4-pro.toml); solid peers match that. This file authors only low|medium|high|xhigh|max, which invents graded levels the lab does not expose and drops the on/off control. Action: Set reasoning_options to lab/peer shape (toggle + high/max, with a leading wire comment) unless Zenifra docs or a live request show a different control surface; do not keep a full L/M/H-style enum by default.
  • [high] [violation] providers/zenifra/models/deepseek-v4-flash-0731.toml:5 - Check: Same DeepSeek V4 relay baseline. Why: Lab Flash paths use toggle + low/high/max (or high/max); this entry uses low|medium|high|xhigh|max with no toggle, which is not the native/peer set. Action: Align to DeepSeek lab/peer controls (include toggle if the host forwards thinking.type / equivalent); only keep extra levels with host-specific evidence.
  • [high] [violation] providers/zenifra/models/glm-5.2.toml:5 - Check: GLM-5.2 effort baseline is lab high/max, not a GPT-style ladder. Why: providers/zhipuai/models/glm-5.2.toml and providers/zai/models/glm-5.2.toml document effective levels high/max (with low/medium mapped to high). This PR sets low|medium|high|xhigh|max, inventing a broader enum. Action: Use [{ type = "effort", values = ["high", "max"] }] (or lab-equivalent with verified none off) unless Zenifra proves different wire values.
  • [high] [violation] providers/zenifra/models/qwen3.7-max.toml:4 - Check: Relays must not use reasoning_options = [] when the lab/peers expose caller controls. Why: Alibaba Qwen3.7 Max is toggle + budget_tokens; peers such as Modelis match that. Empty means no control, not “unknown from /v1/models.” Action: Author the host’s real controls (at least lab-like toggle/budget if forwarded), or document affirmative evidence that Zenifra exposes none.
  • [high] [violation] providers/zenifra/models/qwen3.7-plus.toml:5 - Check: Same Qwen3.7 Plus relay rule. Why: Lab and peers use toggle + budget_tokens; this file sets []. Action: Copy the lab/peer option set for this host’s API, or prove Zenifra has no thinking controls.
  • [high] [violation] providers/zenifra/models/qwen3.8-max.toml:7 - Check: Effort values must be the native/peer set, not a full schema dump. Why: Alibaba Qwen3.8 Max is toggle + low/medium/xhigh + budget_tokens. This PR uses none|minimal|low|medium|high|xhigh|max with no toggle/budget—anti-pattern full enum and wrong baseline. Action: Match lab/peer shape for the completions path Zenifra serves; only add levels with host-specific proof.
  • [high] [violation] providers/zenifra/models/qwen3.8-flash.toml:6 - Check: Same Qwen3.8 Flash baseline. Why: Lab is toggle + low/medium/xhigh + budget_tokens; this file dumps the full effort enum only. Action: Align to lab/peer controls for this host.
  • [high] [violation] providers/zenifra/models/qwen3.8-27b.toml:6 - Check: Qwen3.8-27B peer/lab effort is low/medium/xhigh (often with toggle), not the full enum. Why: Cortecs/Cloudflare peers use low|medium|xhigh (± toggle). This file sets none|minimal|low|medium|high|xhigh|max. Action: Replace with the verified host set based on lab/peers, not the entire effort vocabulary.
  • [medium] [possible mistake] providers/zenifra/models/kimi-k2.5.toml:7 - Check: [] on a relay requires affirmative “no caller control.” Why: Lab metadata is reasoning = true; many same-model relays use toggle. Empty here has no wire comment affirming no control—only a models-list citation. Action: Confirm whether Zenifra exposes thinking on/off (or effort); if it does, author that option; if not, state that explicitly in the leading comment.
  • [medium] [possible mistake] providers/zenifra/models/qwen3.8-27b.toml:4 - Check: Overrides must stay consistent with inherited modalities. Why: Several entries set attachment = false (and/or drop text-only [modalities]) while base_model still supplies image/video (and pdf for max). Clients can inherit multimodal input with attachment = false. The prior Zenifra Qwen route overrode modalities to text-only. Action: For each text-only host route (qwen3.8-27b, qwen3.8-flash, qwen3.8-max, qwen3.7-plus, kimi-k2.5, kimi-k2.7-code, kimi-k3), either override [modalities].input to what Zenifra actually accepts, or keep attachment/modalities aligned with real vision support.
  • [medium] [possible mistake] providers/zenifra/models/deepseek-v4-pro.toml:4 - Check: structured_output overrides need host evidence. Why: Lab DeepSeek/GLM/Qwen3.8-27B mark structured_output = true; several Zenifra files force false (and Qwen3.7 forces true where lab omits it) with only a models-list source. Action: Verify against Zenifra docs/API behavior and keep the override only where the host truly differs; remove redundant restates of the base value.
  • [medium] [possible mistake] providers/zenifra/models/qwen3.7-plus.toml:18 - Check: Context tier threshold should match the provider’s pricing boundary. Why: Lab and other hosts use tier size 256_000 for Qwen3.7 Plus; this PR uses 256_001. That is a suspicious off-by-one if the band starts at 256k. Action: Confirm the Zenifra BRL tier cutover and set tier.size to that exact token threshold.
  • [low] [possible mistake] .pr-review/pull-request.json - Check: Material cost/capability data should cite direct provider pricing/docs mapped to claims. Why: Body cites conversion rate and GET /v1/models, but not a pricing/docs page mapping BRL→USD fields, tier, limits, or reasoning wire paths per model. Action: Add first-party Zenifra pricing/docs (or models payload excerpts) stating what each supports: USD costs after BRL/5.20, tier, limits, and reasoning controls.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/zenifra/models/qwen3.8-27b.toml:8 - Check: Reasoning options must follow the lab/peer baseline for this model, not a full effort enum dump. Why: Lab Alibaba and established peers use a narrow set (typically toggle + low/medium/xhigh, or none/low/medium/xhigh), not none|minimal|low|medium|high|xhigh|max. Authored full-schema dumps misrepresent caller controls and break the audit baseline. The same pattern is on qwen3.8-flash.toml and qwen3.8-max.toml. Action: Replace with the intersection Zenifra actually accepts that matches lab/peer controls (and add a leading wire comment). Drop levels that only appear because the gateway schema lists every enum value.
  • [high] [violation] providers/zenifra/models/qwen3.7-max.toml:7 - Check: On multi-model relays, reasoning_options = [] means no caller control, not “not listed / unsure.” Why: First-party Alibaba uses toggle + budget_tokens for Qwen3.7 Max/Plus; OpenRouter peers expose at least a toggle. Comments only cite absence from supported_parameters, which is not enough when the lab and peers expose controls (and Zenifra already documents reasoning_effort on sibling Qwen3.8 routes). Same issue on qwen3.7-plus.toml. Action: Author the controls Zenifra forwards (toggle and/or budget/effort per this host’s wire path), or prove requests with lab-style thinking params are rejected and keep [] with that evidence.
  • [high] [violation] providers/zenifra/models/kimi-k2.5.toml:7 - Check: Provider overrides must stay consistent after base_model merge. Why: attachment = false is set while [modalities] is not overridden, so the resolved model still inherits multimodal inputs (image/video on Kimi/Qwen bases) with attachments disabled—contradictory catalog data. Same pattern on kimi-k2.7-code.toml, kimi-k3.toml, qwen3.7-plus.toml, qwen3.8-27b.toml, qwen3.8-flash.toml, and qwen3.8-max.toml. Action: If Zenifra is text-only, override [modalities].input = ["text"] (and keep attachment = false). If multimodal input is real, drop the false attachment override.
  • [medium] [possible mistake] providers/zenifra/models/kimi-k2.5.toml:10 - Check: Relay reasoning options for Kimi K2.5 vs lab/peer surface. Why: OpenRouter/Vercel peers expose a reasoning toggle for this model; Zenifra uses [] only because supported_parameters omits a control. That can under-report a real on/off path on an OpenAI-compatible host. Action: Confirm whether a toggle (or other thinking field) is accepted on Zenifra; if yes, author it with a leading wire comment; if no, keep [] and note the failed control path.
  • [medium] [possible mistake] providers/zenifra/models/kimi-k3.toml:13 - Check: Provider limit.output should be a real max completion size, not the context window. Why: Override sets output = 1_048_576 while lab metadata is context = 1_048_576 / output = 131_072. Using the full context as output is a common models-list mis-map and can inflate completion limits. Action: Verify Zenifra’s max output tokens for this route; if it matches lab (~131K) or another documented cap, correct the override.
  • [low] [possible mistake] providers/zenifra/models/qwen3.7-plus.toml:18 - Check: Context tier threshold should match the provider’s pricing band start. Why: Tier uses size = 256_001 while Alibaba and OpenRouter peers use 256_000 for the same Qwen3.7 Plus band. An off-by-one threshold mis-applies the higher price band. Action: Confirm Zenifra’s exact tier boundary and align size (almost certainly 256_000 unless docs say otherwise).
  • [low] [possible mistake] providers/zenifra/models/deepseek-v4-flash-0731.toml:2 - Check: Non-USD costs must convert with a noted rate/date from a real FX source. Why: Comments call R$5.20 = US$1.00 a “project rate” with no exchange-rate source; other providers cite ECB/CBR (or similar). An unanchored rate can systematically skew all USD/MTok values. Action: Cite the FX source used for 2026-09-12 (or recompute from that source) in the leading conversion comment / PR body.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/zenifra/models/zenifra/deepseek-v4-pro.toml:8 - Check: Reasoning options must match the lab / same-surface baseline for that model (not a generic enum). Why: First-party DeepSeek Pro and solid peers use toggle + effort high|max only (lab maps low/medium→high). This file and the new generate test both advertise low|high|max, inventing a Flash-style low level for Pro. Action: Change Pro effort to ["high", "max"], update the wire comment, and fix the Zenifra exposes only native reasoning controls expectation for zenifra/deepseek-v4-pro.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/glm-5.2.toml:9 - Check: Relay reasoning controls must match lab/peers for this host’s real wire surface. Why: ZhipuAI/Z.AI catalog GLM-5.2 as effort-only high|max (off via effort mapping, not a separate toggle). This PR adds { type = "toggle" } with enable_thinking, which is not the lab baseline. Action: Confirm Zenifra actually exposes enable_thinking for this model; if not, drop the toggle and keep effort high|max only (and update the test).
  • [medium] [possible mistake] providers/zenifra/models/zenifra/deepseek-v4-flash-0731.toml:3 - Check: Toggle wire comments must name the real request field on this host. Why: Comments claim enable_thinking = true|false, while DeepSeek first-party and peers document thinking.type = enabled|disabled. A wrong wire path misleads consumers even if effort values are right. Action: Verify Zenifra’s DeepSeek toggle field and align the leading comments (and keep Flash effort as low|high|max only if that matches the host).
  • [medium] [possible mistake] providers/zenifra/models/zenifra/qwen3.7-plus.toml:22 - Check: Context tier size is the threshold where the higher band starts. Why: Alibaba and established peers use 256_000 for Qwen3.7 Plus; this file uses 256_001, which shifts the tier boundary by one token versus the usual band. Action: Confirm Zenifra’s priced breakpoint; if it is the standard 256k band, set size = 256_000.
  • [low] [possible mistake] .pr-review/pull-request.json (PR body) - Check: Data-changing PRs should cite direct provider pricing/docs mapped to claims. Why: Body notes BRL→USD at R$5.20 and the models list, but does not point to Zenifra pricing/docs pages or map which BRL list prices support each cost/tier. Action: Add first-party pricing/docs links and briefly state what each supports (list prices, tier breakpoint, model IDs / zenifra/ namespace).

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/zenifra/models/zenifra/qwen3.8-27b.toml:6 - Check: Provider overrides after base_model must stay consistent with inherited modalities (real host deltas only). Why: The file sets attachment = false but does not override [modalities]. The lab base (models/alibaba/qwen3.8-27b.toml) still contributes input = ["text", "image", "video"] and attachment = true, so the merged model advertises vision/video inputs while claiming no attachments. Action: Either drop attachment = false (and keep multimodal inheritance) or keep text-only hosting and set [modalities] input = ["text"] (and matching output) alongside attachment = false. Update the new attachment test expectation to match.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/kimi-k3.toml:9 - Check: Provider limit.output must reflect the host’s real max output, not context. Why: output = 1_048_576 matches the lab context size, while lab/Moonshot metadata use output = 131_072. Treating full context as max output is a common catalog error and inflates capability. Action: Verify Zenifra’s advertised max completion tokens for zenifra/kimi-k3; if it is not ~1M, set limit.output to the real value (likely ~131_072) or omit the override to inherit the lab default.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/qwen3.7-plus.toml:18 - Check: Context pricing tiers should use the provider’s real threshold. Why: tier.size = 256_001 is unique in-tree; Alibaba and established relays use 256_000 for Qwen3.7 Plus long-context pricing. An off-by-one threshold mis-bands cost. Action: Confirm the exact Zenifra/BRL tier cutoff from pricing docs; if the band starts at 256K tokens, use size = 256_000 (or document why 256_001 is intentional).
  • [low] [possible mistake] providers/zenifra/models/zenifra/deepseek-v4-pro.toml:7 - Check: Relay reasoning effort must match lab/same-surface peers unless this host proves extra levels. Why: First-party DeepSeek V4 Pro is toggle + high|max only; this entry adds low (Flash-style). Extra levels need host-proven effect, not only a /v1/models assertion. Action: Confirm Zenifra actually accepts and applies reasoning_effort=low for zenifra/deepseek-v4-pro; if not, use ["high", "max"] like providers/deepseek/models/deepseek-v4-pro.toml.

@ramonpaolo
ramonpaolo force-pushed the feat/zenifra-hosted-models branch from 948458c to 7e49b55 Compare September 22, 2026 23:11
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [possible mistake] providers/zenifra/models/zenifra/kimi-k3.toml:8 - Check: Provider [limit] overrides must reflect the host's real serving limits, not swap context/output. Why: File sets [limit] output = 1_048_576 while models/moonshotai/kimi-k3.toml has context = 1_048_576 / output = 131_072; provider output equals lab context and is 8x lab output, indicating context was copied into output. Action: Correct to a verified host output limit or remove the override to inherit 131_072.
  • [high] [violation] providers/zenifra/models/zenifra/glm-5.1.toml:3 - Check: Every toggle requires a leading top-of-file wire comment with the exact request field (AGENTS.md → Reasoning options). Why: glm-5.1.toml, qwen3.6-flash.toml, and qwen3.6-plus.toml author reasoning_options = [{ type = "toggle" }] but only have # No native reasoning_effort levels advertised; expose the model's thinking toggle only with no Toggle: ... wire path, unlike the compliant # Toggle: enable_thinking = true|false used elsewhere in this PR. Action: Add the exact Zenifra wire path for the toggle to the header block in all three files.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/kimi-k2.5.toml:4 - Check: base_model files must keep only real provider deltas, not restate or invent capabilities. Why: kimi-k2.5.toml, kimi-k2.7-code.toml, and kimi-k3.toml set temperature = true while models/moonshotai/kimi-k2.5.toml, kimi-k2.7-code.toml, and kimi-k3.toml all have temperature = false and providers/moonshotai/models/kimi-k3.toml / kimi-k2.7-code.toml inherit false; a relay cannot make a model respect temperature the lab marks unsupported. Action: Remove the temperature = true overrides or provide direct Zenifra evidence that temperature has effect on these routes.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/deepseek-v4-pro.toml:5 - Check: Relay effort sets must copy the lab + same-surface peer baseline, not narrow without host evidence. Why: First-party providers/deepseek/models/deepseek-v4-pro.toml is toggle + effort [low, high, max] and Zenifra deepseek-v4-flash-0731.toml in this PR keeps [low, high, max], but Zenifra deepseek-v4-pro.toml narrows to [high, max] with only a GET /v1/models assertion; same host differing per-model needs verification. Action: Verify Zenifra supported_parameters for this route and restore low if the host forwards it.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/glm-5.2.toml:5 - Check: Do not add or drop toggle controls relative to the native baseline without host evidence. Why: First-party providers/zhipuai/models/glm-5.2.toml is effort [high, max] only with off via none|minimal, but Zenifra adds { type = "toggle" }; conversely first-party providers/moonshotai/models/kimi-k3.toml is toggle + effort [low, high, max] but Zenifra kimi-k3.toml drops the toggle as always-on. Action: Confirm from Zenifra supported_parameters/docs whether enable_thinking exists for GLM-5.2 and whether Kimi-K3 has no off control, and align to the verified surface.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [critical] [violation] providers/zenifra/models/zenifra/deepseek-v4-pro.toml:1 - Check: Relay model IDs must preserve the lab/upstream namespace, not use a provider namespace. Why: Base revision uses providers/zenifra/models/alibaba/qwen3.6-35b-a3b.toml (alibaba/...) and AGENTS.md/OpenRouter/Kilo use providers/<relay>/models/<lab>/... (e.g. providers/openrouter/models/anthropic/...); this PR moves all routes to providers/zenifra/models/zenifra/... yielding zenifra/... IDs that imply a zenifra lab and break AI-SDK lookup consistency. Action: Restore lab-namespaced paths (e.g. providers/zenifra/models/deepseek/..., providers/zenifra/models/alibaba/..., providers/zenifra/models/moonshotai/..., providers/zenifra/models/zhipuai/...) matching the base_model lab, or provide API evidence that Zenifra serves zenifra/... IDs.
  • [high] [violation] packages/core/test/generate.test.ts:805 - Check: Catalog PRs are catalog-only (AGENTS.md). Why: This PR adds provider-specific snapshot tests (Zenifra model IDs..., Zenifra exposes only native reasoning controls, Zenifra attachment..., Zenifra serves current limits...) that lock in its own contested IDs/costs/limits/reasoning values and will fail legitimate future corrections. Action: Revert all packages/core/test/generate.test.ts changes; keep the PR to models/ + providers/ data files.
  • [high] [possible mistake] providers/zenifra/models/zenifra/kimi-k3.toml:10 - Check: [limit] correctness vs inherited lab limits. Why: Diff authors [limit] output = 1_048_576 while models/moonshotai/kimi-k3.toml is context = 1_048_576, output = 131_072; merged result becomes context 1M/output 1M (8x lab output, output equals context), with no comment or tier justification. Action: Verify Zenifra's advertised output limit; if not 1M, remove the [limit] override to inherit lab limits or correct to the documented context/output values.
  • [high] [possible mistake] providers/zenifra/models/zenifra/glm-5.2.toml:6 - Check: Reasoning baseline must copy lab + same-surface peers; do not invent toggle. Why: First-party providers/zhipuai/models/glm-5.2.toml is effort-only ["high","max"] with no toggle, but Zenifra authors toggle + effort ["high","max"] with only enable_thinking assertion. Action: Remove the invented toggle or cite Zenifra docs/supported_parameters showing a real on/off field forwarded on this route.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/deepseek-v4-pro.toml:8 - Check: Baseline effort must be native/peer set, consistent per family on same host. Why: First-party providers/deepseek/models/deepseek-v4-pro.toml and OpenRouter peers use toggle + ["low","high","max"]; Zenifra flash keeps low|high|max but pro drops to high|max on the same host with only a GET /v1/models comment, an unexplained per-model divergence. Action: Align both to the lab set or provide per-model Zenifra evidence that low is unsupported on pro but supported on flash.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/kimi-k3.toml:5 - Check: Do not drop lab toggle from uncertainty. Why: First-party providers/moonshotai/models/kimi-k3.toml is toggle + effort ["low","high","max"]; Zenifra keeps effort but drops toggle claiming “always on” without showing supported_parameters/docs that off is unavailable. Action: Restore toggle with wire comment if Zenifra forwards thinking.type, or cite affirmative host evidence that thinking cannot be disabled.
  • [medium] [possible mistake] providers/zenifra/models/zenifra/qwen3.8-max.toml:6 - Check: budget_tokens only for real reasoning budgets; do not silently drop lab budget. Why: First-party providers/alibaba/models/qwen3.8-max.toml / qwen3.8-flash.toml / qwen3.7-max / qwen3.7-plus / qwen3.6-flash / qwen3.6-plus all expose budget_tokens (thinking_budget); all Zenifra Qwen routes drop it to toggle or toggle+effort with “no native effort levels” notes but no statement that thinking_budget is absent on Zenifra. Action: Verify whether Zenifra forwards thinking_budget; restore {type="budget_tokens"} with bounds if it does, or document the absence in the leading header.
  • [low] [violation] .pr-review/diff.patch:4 - Check: Data-changing PRs should cite direct provider pricing/docs/API mapped to claims. Why: PR body lists conversions and capability changes but provides no URLs; TOML headers cite only GET https://ai.zenifra.com/v1/models which cannot be verified here, leaving expanded limits (deepseek output 393_216 vs lab 384_000, qwen3.7-max/plus output 131_072 vs lab 65_536/64_000, glm-5.1 context 202_745 vs 200_000, glm-5.2 context 1_048_576 vs 1_000_000, tiers 32_001/256_001) and narrowed temperature/structured_output/modalities unreviewable. Action: Add first-party or Zenifra doc/API references stating what each citation supports, and clarify which price band (peak vs noted off-peak BRL rows) the USD costs represent.

@ramonpaolo

Copy link
Copy Markdown
Contributor Author

@rekram1-node

Hi

Can you merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant