Skip to content

fix(alibaba-token-plan): correct model capabilities and limits against the live gateway, add HappyHorse video - #3695

Merged
rekram1-node merged 6 commits into
anomalyco:devfrom
oliver-mee:feat/token-plan-corrections-video
Jul 24, 2026
Merged

rekram1-node merged 6 commits into
anomalyco:devfrom
oliver-mee:feat/token-plan-corrections-video

Conversation

@oliver-mee

@oliver-mee oliver-mee commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Both Token Plan region providers (alibaba-token-plan and alibaba-token-plan-cn) carried a
few capability and limit values that the live gateway contradicts, and were missing the
HappyHorse video models the plan serves. Everything here was checked by probing the gateway
directly on 2026-07-24, not read off the console or a price sheet (several of which are wrong on
these exact fields).

Corrections

  • kimi-k2.5, kimi-k2.6: drop base_model_omit = ["structured_output"]. The gateway accepts
    response_format json_schema on both (a strict-schema request returns the expected object).
  • kimi-k2.6: remove the [limit] output = 16_384 override so it inherits the base 262_144.
    The 16K figure (which the console and both price sheets also carry) is wrong: a
    max_tokens = 17000 request truncated at exactly 17000 with finish_reason = length, and a
    real run emitted 33,718 tokens with finish_reason = stop. The gateway accepts max_tokens up
    to 262,144 and rejects 262,145, so output is bounded only by the context window.
  • kimi-k2.5: [limit] output from 32_768 to 98_304, its enforced max_tokens ceiling
    (the gateway rejects requests above 98,304, distinct from k2.6 and k2.7-code at 262,144).
  • qwen3.8-max-preview, qwen3.7-max, qwen3.7-plus, qwen3.6-plus, glm-5: add
    structured_output = true. The gateway does json_schema even though the base models report
    none. qwen3.6-plus gained json_schema recently (it was json_object only when first probed on
    2026-07-17), so it now matches its sibling qwen3.6-flash.
  • qwen3.7-max, qwen3.7-plus, qwen3.6-plus, qwen3.6-flash: add [interleaved]
    reasoning_content, matching the GLM, Kimi and DeepSeek entries, which all stream reasoning the
    same way.
  • deepseek-v4-pro, deepseek-v4-flash: add cache_write = 0 (they had cache_read only;
    prepaid plan, so 0).

Corrections (second pass, 2026-07-24)

Re-probing the full chat catalogue turned up four more values, added in a third commit:

  • kimi-k2.7-code: drop base_model_omit = ["structured_output"]. It now honours a strict
    json_schema (returned exactly {"name":"Alice","age":30} with finish_reason = stop, with
    and without the json keyword). This capability was absent on 2026-07-17 and has since appeared.
  • qwen3.7-max: add [limit] output = 131_072 (accepts max_tokens 131,072, rejects 131,073)
    • double the inherited 65,536 and double its sibling qwen3.7-plus.
  • qwen3.7-plus: add [limit] output = 65_536 (accepts 65,536, rejects 65,537); the inherited
    model-metadata value is 64,000.
  • MiniMax-M2.5: [limit] output from 24_576 to 32_768, its enforced max_tokens ceiling
    (rejects 32,769). structured_output stays absent: a json_schema request came back wrapped in
    markdown fences, i.e. free-form, not enforced.

New models: HappyHorse 1.1 video

happyhorse-1.1-{t2v,i2v,r2v} added to both region providers. These are Token Plan supported
models (listed on the supported-model pages) served on the async video-synthesis endpoint
(POST .../api/v1/services/aigc/video-generation/video-synthesis with X-DashScope-Async: enable), not the OpenAI-compatible /models list, which is why they never appear in a /models
listing. I confirmed both tiers can call them: a job submitted to that endpoint returned a
task_id and ran (PENDING then RUNNING) with no entitlement error. family is omitted because
HappyHorse is not in the family enum yet; happy to add it to the enum in a follow-up if you would
prefer that.

Notes

  • bun validate passes and git diff --check is clean. No sync module touches this provider, so
    the hand-authored source comments persist.
  • Sources are cited in each file's leading comment block (Alibaba Model Studio docs and the
    HappyHorse text-to-video API reference).
  • The China provider tracks the same catalogue as Global: separate keys and endpoints, same
    models.

Three commits: the first-pass corrections, the video additions, then a second pass of
gateway-verified corrections. Happy to split into separate PRs if you would rather review them
separately.


🤖 Generated with Claude Code (Claude Opus 4.8)
🧑‍💻 Ideated, directed and reviewed by a human, @oliver-mee

…live gateway

Probed the Token Plan gateway directly (2026-07-24); several values were wrong
in both region providers:

- kimi-k2.5/k2.6: drop base_model_omit=["structured_output"] — the gateway
  accepts response_format json_schema on both.
- kimi-k2.6: remove the [limit] output=16_384 override (inherits base 262_144).
  A max_tokens=17,000 request truncated at exactly 17,000 (finish_reason=length)
  and a real run emitted 33,718 tokens (finish_reason=stop), disproving the
  console/price-sheet "16K". max_tokens accepts up to 262,144, rejects 262,145.
- kimi-k2.5: [limit] output 32_768 -> 98_304 (its enforced max_tokens ceiling).
- qwen3.8-max-preview, qwen3.7-max, qwen3.7-plus, qwen3.6-plus, glm-5: add
  structured_output=true (json_schema works though base/console report none;
  qwen3.6-plus gained json_schema since the 2026-07-17 probe, matching flash).
- qwen3.7-max/plus, qwen3.6-plus/flash: add [interleaved] reasoning_content.
- deepseek-v4-pro/flash: add cache_write=0.

Citations are in each file's leading comment block.
happyhorse-1.1-{t2v,i2v,r2v} are Token Plan supported models served on the async
video-synthesis endpoint (POST .../api/v1/services/aigc/video-generation/
video-synthesis, X-DashScope-Async), not the OpenAI-compatible /models list.
Entitlement confirmed live 2026-07-24 on both tiers (Personal and Team keys each
accepted a t2v job: task_id + PENDING->RUNNING). Credit-billed, so cost is 0.
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/alibaba-token-plan/models/happyhorse-1.1-i2v.toml:14 - Check: attachment should match non-text input modalities. Why: attachment = false while modalities.input includes image (same on happyhorse-1.1-r2v and both CN copies). Catalog consumers that gate file/image upload on attachment will treat these as text-only and cannot send the required image. Peer video models with image input set attachment = true. Action: Set attachment = true on all four HappyHorse i2v/r2v files (both regions), or document why image input does not count as attachment support.
  • [medium] [possible mistake] providers/alibaba-token-plan/models/happyhorse-1.1-i2v.toml:29 - Check: Image-to-video input modalities. Why: i2v is input = ["image"] only, while r2v is ["image", "text"] and t2v is ["text"]. Image-to-video APIs almost always accept a text prompt with the image; omitting text is internally inconsistent with the sibling variants and may understate the API. Action: Verify against the HappyHorse i2v request schema and add "text" to i2v modalities.input in both regions if prompts are supported.

…dels

The reviewer bot correctly flagged happyhorse-1.1-i2v and -r2v: they take an
image as input, so attachment should be true, not false. Consumers that gate
image upload on attachment would otherwise treat them as text-only. t2v stays
false (text input only).
@oliver-mee

Copy link
Copy Markdown
Contributor Author

Good catch, thank you. Fixed in 67cfb5d: happyhorse-1.1-i2v and -r2v take an image as input, so they now set attachment = true in both regions. t2v stays false since it is text-only. I also derive attachment from the input modalities in my generator now, so this will not come back.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/alibaba-token-plan/models/happyhorse-1.1-i2v.toml:29 - Check: Image-to-video input modalities should match the provider API. Why: happyhorse-1.1-i2v sets input = ["image"] only (same in alibaba-token-plan-cn). Sibling r2v includes text, and well-specified i2v entries elsewhere use text+image because a prompt is part of the request. Image-only input is unique in this catalog and will hide prompt support in clients. Action: Confirm against the HappyHorse i2v request schema; if a text prompt is accepted, set input = ["image", "text"] in both region files.

The Alibaba image-to-video API takes an image (anchors the first frame) plus a
text prompt (drives the motion), so input is ["image", "text"], not ["image"]
alone. This matches sibling r2v. Confirmed against the HappyHorse i2v API docs.
@oliver-mee

Copy link
Copy Markdown
Contributor Author

Confirmed and fixed in be249ab. The image-to-video API takes an image (which anchors the first frame) plus a text prompt (which drives the motion), so happyhorse-1.1-i2v now has input = ["image", "text"] in both regions, matching r2v. Thanks for the second look.

@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

…e gateway

Re-probing the full chat catalogue on 2026-07-24 surfaced four values the
providers still got wrong. All verified by probing the live gateway directly.

- kimi-k2.7-code: drop base_model_omit = ["structured_output"]. The gateway now
  honours a strict response_format json_schema (a strict-schema request returned
  exactly {"name":"Alice","age":30} with finish_reason=stop, with and without the
  "json" keyword), so inheriting the base model's structured_output = true is
  correct. This capability was absent at the earlier probe and has since appeared.
- qwen3.7-max: add [limit] output = 131_072. The gateway accepts max_tokens up to
  131,072 and rejects 131,073 - double the inherited 65,536 and double its sibling
  qwen3.7-plus, so the inherited value under-reports by half.
- qwen3.7-plus: add [limit] output = 65_536. The gateway accepts max_tokens up to
  65,536 and rejects 65,537; the inherited model-metadata value is 64,000.
- MiniMax-M2.5: [limit] output 24_576 -> 32_768, its enforced max_tokens ceiling
  (accepts 32,768, rejects 32,769). structured_output stays absent: a json_schema
  request came back wrapped in markdown fences, i.e. free-form, not enforced.

Both region providers updated identically. Sources cited in each file header.
@oliver-mee oliver-mee changed the title fix(alibaba-token-plan): correct capabilities/limits vs live gateway + add HappyHorse video fix(alibaba-token-plan): correct model capabilities and limits against the live gateway, add HappyHorse video Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

The gateway enforces a thinking_budget ceiling of 131,072 on qwen3.6-plus and
qwen3.6-flash (probed 2026-07-24: max_tokens/thinking_budget accepts 131,072 and
rejects 131,073). Alibaba's docs state 81,920, but the live gateway accepts up to
131,072, so the documented figure under-reports the real limit. Both region
providers updated; the leading comment records the doc-vs-gateway difference.
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

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.

2 participants