Skip to content

feat(provider): add Runware as a new provider - #2875

Merged
steebchen merged 23 commits into
theopenco:mainfrom
Runware:runware
Jul 27, 2026
Merged

steebchen merged 23 commits into
theopenco:mainfrom
Runware:runware

Conversation

@teith

@teith teith commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds Runware (https://api.runware.ai, OpenAI-compatible) as a supported gateway provider.

  • Provider definition, endpoint routing, request headers, and streaming passthrough
  • Runware pricing/model mappings added to existing catalog entries across Anthropic, OpenAI, Google, DeepSeek, MiniMax, Moonshot, Alibaba (Qwen), xAI, and GLM

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

    • Added Runware as an available AI provider.
    • Added Runware support for a broad selection of Anthropic, DeepSeek, Google, MiniMax, Moonshot, OpenAI, xAI, and zai models.
    • Enabled streaming, reasoning, tool use, vision, and structured JSON output where supported.
    • Added automatic Runware endpoint and authentication configuration.
  • Bug Fixes

    • Improved streaming completion status handling for Runware responses.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds Runware as a configured provider, including endpoint and bearer-header handling, streaming finish-reason normalization, provider metadata, and model mappings across multiple model catalogs.

Changes

Runware Provider Integration

Layer / File(s) Summary
Provider registry and routing
packages/models/src/providers.ts, packages/actions/src/get-provider-endpoint.ts, packages/actions/src/get-provider-headers.ts, apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
Registers Runware, resolves https://api.runware.ai, applies bearer authentication, and normalizes OpenAI-compatible streaming finish reasons.
Model provider mappings
packages/models/src/models/deepseek.ts, packages/models/src/models/google.ts, packages/models/src/models/minimax.ts, packages/models/src/models/moonshot.ts, packages/models/src/models/openai.ts, packages/models/src/models/xai.ts, packages/models/src/models/zai.ts
Adds Runware external IDs, pricing, limits, and capability flags for the listed DeepSeek, Gemini/Gemma, MiniMax, Moonshot, OpenAI, xAI, and zai models.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: steebchen, smakosh

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Runware as a new provider.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/actions/src/get-provider-endpoint.ts (1)

298-300: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Base URL resolution for Runware looks correct.

Falls through to the default ${url}/v1/chat/completions path in the second switch, matching the OpenAI-compatible chat completions contract described in the PR.

Consider adding a getProviderEndpoint test case for runware alongside 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

📥 Commits

Reviewing files that changed from the base of the PR and between 97141a4 and 09e8b90.

📒 Files selected for processing (13)
  • apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
  • packages/actions/src/get-provider-endpoint.ts
  • packages/actions/src/get-provider-headers.ts
  • packages/models/src/models/alibaba.ts
  • packages/models/src/models/anthropic.ts
  • packages/models/src/models/deepseek.ts
  • packages/models/src/models/google.ts
  • packages/models/src/models/minimax.ts
  • packages/models/src/models/moonshot.ts
  • packages/models/src/models/openai.ts
  • packages/models/src/models/xai.ts
  • packages/models/src/models/zai.ts
  • packages/models/src/providers.ts

Comment thread packages/models/src/models/google.ts Outdated
Comment thread packages/models/src/models/minimax.ts Outdated
@teith

teith commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

@steebchen

Copy link
Copy Markdown
Member

please contact us for adding new providers. however, we're generally not looking to add new gateways at this time.

@steebchen steebchen closed this Jul 2, 2026
@steebchen

Copy link
Copy Markdown
Member

hey @teith, if you’re interested to get this merged and listed, please refer to this form: https://llmgateway.io/add-provider

@shariqmanji

shariqmanji commented Jul 14, 2026 •

Copy link
Copy Markdown

@steebchen, Hi, Shariq here from Runware. Thanks for the guidance - we've submitted an application

@steebchen steebchen reopened this Jul 14, 2026
teith and others added 8 commits July 14, 2026 20:00
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>
steebchen and others added 2 commits July 25, 2026 12:45
# 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>
@steebchen
steebchen enabled auto-merge July 27, 2026 16:36
@steebchen
steebchen added this pull request to the merge queue Jul 27, 2026
Merged via the queue into theopenco:main with commit 909e7ec Jul 27, 2026
10 checks passed
@steebchen
steebchen deleted the runware branch July 27, 2026 18:04
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.

3 participants