Skip to content

feat(provider): add Runware provider - #2808

Closed
DaWe35 wants to merge 2 commits into
theopenco:mainfrom
DaWe35:add-runware-provider
Closed

DaWe35 wants to merge 2 commits into
theopenco:mainfrom
DaWe35:add-runware-provider

Conversation

@DaWe35

@DaWe35 DaWe35 commented Jun 24, 2026 •

Copy link
Copy Markdown

Hi,

I made this with Opus and tested all the added models one by one manually. ✌️

Summary by CodeRabbit

  • New Features
    • Added Runware as a supported provider, including endpoint/header routing and new model offerings across multiple model families.
    • Enabled Runware-backed streaming and tool-call workflows via the existing OpenAI-compatible transformation path.
  • Bug Fixes
    • Improved streamed response normalization, including more consistent token-usage and finish-reason reporting across providers (with added support for Runware-specific finish mapping).
  • Chores
    • Updated the E2E shard workflow to include the Runware API key.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: efa0dab0-e464-4ae8-8b87-498cded4928a

📥 Commits

Reviewing files that changed from the base of the PR and between fa6ff06 and 66eb784.

📒 Files selected for processing (2)
  • packages/models/src/models/google.ts
  • packages/models/src/models/openai.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/models/src/models/openai.ts
  • packages/models/src/models/google.ts

Walkthrough

Adds Runware provider support across routing, headers, model catalog, and CI, and updates streaming-to-OpenAI token usage, finish reasoning, and tool-call metadata handling.

Changes

Runware Provider Integration

Layer / File(s) Summary
Provider definition and routing wiring
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
Defines the Runware provider entry, adds its base URL and default chat-completions endpoint, inserts Runware into the grouped header branch, and routes Runware through the OpenAI-compatible streaming transform path.
Model catalog entries for Runware
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
Adds Runware provider entries to Alibaba, Anthropic, DeepSeek, Google, MiniMax, Moonshot, OpenAI, xAI, and ZAI model definitions with external IDs, pricing, limits, and capability flags.
E2E CI secret
.github/workflows/e2e.yml
Adds LLM_RUNWARE_API_KEY to the e2e-shards job environment.

Streaming Transform Refactors

Layer / File(s) Summary
Usage, finish, and cache transform updates
apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
Reorganizes Anthropic prompt token details, preserves Google prompt-token selection, namespaces Google tool-call thought signatures, refactors Google finish-chunk candidate handling, and updates Bedrock cache creation token fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • theopenco/llmgateway#2162: Modifies the same provider-routing files (transform-streaming-to-openai.ts, get-provider-endpoint.ts, get-provider-headers.ts, providers.ts) to add/remove another provider, directly parallel to this PR's Runware integration.
  • theopenco/llmgateway#2663: Adds deepinfra to the same OpenAI-compatible provider switch in transform-streaming-to-openai.ts that this PR extends with runware.
  • theopenco/llmgateway#2435: Introduces the claude-opus-4-8 model definition in anthropic.ts that this PR extends with a runware provider entry.

Suggested reviewers

  • smakosh
  • steebchen
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Runware provider support across the codebase.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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

🤖 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 850-877: Add the missing cached-input billing field to the Runware
Gemini model mapping so pricing is consistent with the neighboring Runware
entries. Update the object for the Gemini SKU in google.ts alongside the other
pricing fields in the providerId: "runware" mapping, and set cachedInputPrice
using the same pricing conventions already used for gemini-3.5-flash and
gemma-4-31b-it.

In `@packages/models/src/models/openai.ts`:
- Around line 1473-1486: The Runware GPT-5.4 model mappings are missing cached
input pricing, so add cachedInputPrice to the relevant entries in openai.ts for
gpt-5.4, gpt-5.4-mini, and gpt-5.4-nano. Use the existing adjacent OpenAI/Azure
mappings and the gpt-5.5 Runware entry as the reference pattern, and update the
Runware model objects so selector/export pricing paths can read cachedInputPrice
directly.
🪄 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: 1093c333-04f1-4597-adf9-fc1f33da7870

📥 Commits

Reviewing files that changed from the base of the PR and between a272766 and fa6ff06.

📒 Files selected for processing (14)
  • .github/workflows/e2e.yml
  • 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
Comment thread packages/models/src/models/openai.ts
- Introduced `cachedInputPrice` for Google models, enhancing pricing details for both standard and tiered pricing structures.
- Added `cachedInputPrice` for OpenAI models, providing more transparency in pricing for users.
- Updated pricing tiers for both providers to reflect the new cached input prices.
@steebchen steebchen closed this Jun 24, 2026
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