Repository navigation
feat(provider): add Runware as a new provider - #2875
Conversation
# Conflicts: # apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds Runware as a configured provider, including endpoint and bearer-header handling, streaming finish-reason normalization, provider metadata, and model mappings across multiple model catalogs. ChangesRunware Provider Integration
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant Gateway
participant RunwareAPI
Client->>Gateway: Send model request
Gateway->>RunwareAPI: Resolve endpoint and send bearer-authenticated request
RunwareAPI-->>Gateway: Return streaming chunks
Gateway-->>Client: Transform chunks and normalize finish reason
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/actions/src/get-provider-endpoint.ts (1)
298-300: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winBase URL resolution for Runware looks correct.
Falls through to the default
${url}/v1/chat/completionspath in the second switch, matching the OpenAI-compatible chat completions contract described in the PR.Consider adding a
getProviderEndpointtest case forrunwarealongside the existing spec file, since other providers in this switch have corresponding coverage.🤖 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/get-provider-endpoint.ts` around lines 298 - 300, Add test coverage for the runware branch in getProviderEndpoint to match the existing provider cases already covered in the spec file. Update the corresponding getProviderEndpoint test suite to assert that runware resolves to the expected base URL and that it falls through to the OpenAI-compatible /v1/chat/completions endpoint path, using the getProviderEndpoint switch handling as the target behavior.
🤖 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.
Inline comments:
In `@packages/models/src/models/google.ts`:
- Around line 735-749: The new Runware provider entry is being placed first,
which changes the primary provider selected via model.providers[0]. Update the
Google model definitions so the existing Google provider remains the first entry
and append the Runware provider after it; apply the same ordering fix to the
other newly added Runware rows in the Google model list. Use the surrounding
model entries in google.ts to keep provider ordering consistent.
In `@packages/models/src/models/minimax.ts`:
- Around line 12-26: The Runware MiniMax M3 entry in minimax.ts has incorrect
pricing values that are 2× too low. Update the pricing fields on the model
object with externalId "minimax-m3" so inputPrice, outputPrice, and
cachedInputPrice match the published Runware rates, while leaving the existing
contextSize and maxOutput limits unchanged.
---
Nitpick comments:
In `@packages/actions/src/get-provider-endpoint.ts`:
- Around line 298-300: Add test coverage for the runware branch in
getProviderEndpoint to match the existing provider cases already covered in the
spec file. Update the corresponding getProviderEndpoint test suite to assert
that runware resolves to the expected base URL and that it falls through to the
OpenAI-compatible /v1/chat/completions endpoint path, using the
getProviderEndpoint switch handling as the target behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4e6cf2cc-9df9-454e-8ad0-00a07e581c26
📒 Files selected for processing (13)
apps/gateway/src/chat/tools/transform-streaming-to-openai.tspackages/actions/src/get-provider-endpoint.tspackages/actions/src/get-provider-headers.tspackages/models/src/models/alibaba.tspackages/models/src/models/anthropic.tspackages/models/src/models/deepseek.tspackages/models/src/models/google.tspackages/models/src/models/minimax.tspackages/models/src/models/moonshot.tspackages/models/src/models/openai.tspackages/models/src/models/xai.tspackages/models/src/models/zai.tspackages/models/src/providers.ts
|
@coderabbitai resolve |
✅ Action performedComments resolved. Approval is disabled; enable |
|
please contact us for adding new providers. however, we're generally not looking to add new gateways at this time. |
|
hey @teith, if you’re interested to get this merged and listed, please refer to this form: https://llmgateway.io/add-provider |
|
@steebchen, Hi, Shariq here from Runware. Thanks for the guidance - we've submitted an application |
chore(sync): update Runware model catalog
# Conflicts: # packages/models/src/models/minimax.ts # packages/models/src/models/zai.ts # pnpm-lock.yaml
# Conflicts: # packages/actions/src/get-provider-endpoint.ts
- deepseek-v4-pro/flash + gemma-4-31b-it: declare reasoningEfforts (none/high/xhigh/max) since Runware 400s minimal/low/medium via its thinkingLevel setting - same three mappings: json_object is rejected upstream (requires jsonSchema), so jsonOutput: false + jsonOutputSchema: true - glm-5.2: mark unstable — Runware's GLM backend intermittently hangs on tool calls until its own 60s inference timeout - chat-full e2e: pick reasoning_effort via getSupportedReasoningEffort instead of hardcoding medium, matching chat-reasoning Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # apps/gateway/src/chat/tools/transform-streaming-to-openai.ts # packages/models/src/models/openai.ts # packages/models/src/models/zai.ts # packages/models/src/providers.ts
- glm-5.2: replace unstable flag with supportedToolChoices [auto,none]; Runware only hangs on tool_choice: required, so downgrade it to auto - gemma-4-31b-it: drop jsonOutputSchema — Runware's json_schema path hangs until the upstream inference timeout (json_object already 400s) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Runware fixed the backend hang on tool_choice: required for GLM-5.2, so drop the supportedToolChoices downgrade and send it natively. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds Runware (https://api.runware.ai, OpenAI-compatible) as a supported gateway provider.
Pricing, context/output limits, and capability flags are taken from Runware's /v1/models endpoint. Routing verified end-to-end against the gateway (used_provider: "runware" in response metadata, confirmed in gateway debug logs).
Requires LLM_RUNWARE_API_KEY (see .env.example). No DB or default-key changes included.
Summary by CodeRabbit
New Features
Bug Fixes