Repository navigation
feat(models): add ERNIE 4.5 VL 424B A47B - #3586
Conversation
Adds `novita/ernie-4.5-vl-424b-a47b` to the catalogue — Baidu's multimodal
MoE model (424B total, 47B active), 123K context, 16K max output, $0.42/M
in and $1.25/M out.
Everything was verified live against the provider:
- **Tools and JSON output are off.** Both are hard 400s upstream ("model
features function calling not support" / "does not support feature:
structured-outputs").
- **Thinking is off by default and toggled by the chat template.**
`reasoning_effort` is ignored on its own and, sent alongside the flag,
suppresses reasoning entirely — the same shape the DeepSeek V3.2 mapping
on this provider already has. So the mapping declares
`chatTemplateThinkingKey: "enable_thinking"` and keeps `reasoning_effort`
out of `supportedParameters`.
- **Vision works, but the deployment's own URL fetch only decodes JPEG.** A
remote PNG comes back as a bare "invalid request error" while the exact
same bytes are accepted as a data URL.
That last one needed a small gateway change: a `requiresBase64Images`
mapping flag that makes `prepareRequestBody` inline remote images as data
URLs before the request goes out. Every non-`data:` URL goes through
`processImageUrl` with the SSRF guard left on, so https-only, no internal
hosts and no redirects — an `http://` URL is rejected rather than handed to
the provider to fetch on our behalf. AGENTS.md now spells that rule out so
the next place that inlines user content does the same thing.
Scoped e2e passes (95 tests), including the image case with
`EXPERIMENTAL=true`.
|
/e2e |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughAdds Baidu ERNIE 4.5 VL model support through Novita. Remote images are converted to validated base64 data URLs before upstream requests. Tests cover HTTPS, HTTP rejection, data URLs, text content, and reasoning settings. ChangesBaidu ERNIE integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR adds the model mapping and narrowly scoped image handling without a remaining actionable merge-blocking risk; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Client
participant prepareRequestBody
participant processImageUrl
participant Novita
Client->>prepareRequestBody: Submit ERNIE multimodal request
prepareRequestBody->>processImageUrl: Process remote image URL
processImageUrl-->>prepareRequestBody: Return validated base64 data URL
prepareRequestBody->>Novita: Forward prepared request
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/actions/src/prepare-request-body.images.spec.ts (1)
10-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace the dynamic test imports with static imports.
Use a non-dynamic mock or spy for
processImageUrl, and preserve bothprocessImageUrlandImageSizeLimitError, whichprepare-request-body.tsimports.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/actions/src/prepare-request-body.images.spec.ts` around lines 10 - 17, Update the test setup around prepareRequestBody to use static imports instead of importing prepare-request-body.js dynamically. Replace the async vi.mock factory with a static-compatible mock or spy for processImageUrl, while preserving the real processImageUrl and ImageSizeLimitError exports required by prepare-request-body.ts.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/actions/src/prepare-request-body.images.spec.ts`:
- Around line 10-17: Update the test setup around prepareRequestBody to use
static imports instead of importing prepare-request-body.js dynamically. Replace
the async vi.mock factory with a static-compatible mock or spy for
processImageUrl, while preserving the real processImageUrl and
ImageSizeLimitError exports required by prepare-request-body.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 25dd248e-4f9d-49bc-bfa2-831a5e51014a
📒 Files selected for processing (6)
AGENTS.mdpackages/actions/src/prepare-request-body.images.spec.tspackages/actions/src/prepare-request-body.tspackages/models/src/models.tspackages/models/src/models/baidu.tspackages/shared/src/components/models-directory/model-category-filters.ts
|
/e2e |
Adds
novita/ernie-4.5-vl-424b-a47bto the catalogue — Baidu's multimodal MoE model (424B total, 47B active), 123K context, 16K max output, $0.42/M in and $1.25/M out.What the deployment actually does
Every flag here was checked against the live endpoint rather than the model card:
model features function calling not supportanddoes not support feature: structured-outputs.reasoning_effort. Sent on its own,reasoning_effortis ignored; sent alongside the chat-template flag it suppresses reasoning entirely. That is the same shape the DeepSeek V3.2 mapping on this provider already has, so the mapping declareschatTemplateThinkingKey: "enable_thinking"and deliberately keepsreasoning_effortout ofsupportedParameters.invalid request error(reproduced across three different hosts), while the exact same bytes are accepted as adata:URL. A remote JPEG works fine, and a control model on the same provider handles the same PNG URL without complaint, so this is specific to this deployment.The gateway change
That last point needed a small change rather than a
vision: falselie: arequiresBase64Imagesmapping flag that makesprepareRequestBodyinline remote images as data URLs before the request goes out.Every non-
data:URL goes throughprocessImageUrlwith the SSRF guard left on (its default), which is what enforces https-only, blocks internal hostnames and private/reserved/metadata addresses, and refuses redirects. So anhttp://URL is rejected outright instead of being quietly forwarded for the provider to fetch on our behalf — the failure mode that would otherwise turn this feature into an SSRF hole. AGENTS.md now states that rule explicitly so the next place that inlines user-supplied content follows it.The flag is opt-in per mapping, so nothing else in the catalogue changes behaviour.
Verification
TEST_MODELS="novita/ernie-4.5-vl-424b-a47b" pnpm test:e2e→ 95 passed. The image case lives behindEXPERIMENTAL=true, so that was run too and passes.requiresBase64Imagesflipped off (and the cache flushed) the image e2e case fails with a 400, and passes with it on.prepare-request-body.images.spec.tscovers the inlining, the data-URL pass-through, the http rejection path, and the thinking-flag behaviour.pnpm format,pnpm buildandpnpm test:unitall run. Two unrelated unit failures reproduce on a clean tree without these changes (one is a hardcoded gateway port that clashes with a per-worktree stack, the other depends on local provider credentials).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes