Repository navigation
Conversation
Contributor
Reviewer's GuideThis PR integrates Runcrate without new client code by routing it through the existing OpenAI-compatible LLM path, configuring its default endpoint and check model, registering six dynamically discoverable chat models with metadata, and adding localized provider presentation and branding. Review should focus on the correctness and durability of the externally sourced model capabilities/pricing, provider registration consistency, and UI behavior; the author reports typecheck, lint, build, and live streaming checks, but no browser-level UI validation. Sequence diagram for Runcrate model discovery and streaming chatsequenceDiagram
participant Console as WebConsole
participant Service as llmChatService
participant Adapter as ProviderAdapter
participant Runcrate as RuncrateAPI
Console->>Service: getModelsByProvider(runcrate)
Service->>Runcrate: GET /v1/models
Runcrate-->>Service: Six model definitions
Service-->>Console: Runcrate model list
Console->>Service: sendMessage(runcrate)
Service->>Adapter: getDefaultBaseURL(runcrate)
Adapter-->>Service: https://api.runcrate.ai/v1
Service->>Runcrate: POST /v1/chat/completions with stream true
Runcrate-->>Service: Streaming completion
Service-->>Console: Streamed assistant response
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="web/src/config/ai-models/runcrate.ts" line_range="18" />
<code_context>
+ id: 'deepseek-ai/DeepSeek-V4.1-Flash',
+ maxOutput: 1_048_576,
+ pricing: {
+ input: 0.147,
+ output: 0.441,
+ },
</code_context>
<issue_to_address>
**Runcrate prices appear 1,000× higher**
When runcrate model cards are converted through `getProviderModels`, `convertToLLMModel` marks prices below 1 as `per_1k_tokens` even though Runcrate supplies USD per 1M tokens, so callers see costs 1,000 times too high.
Update the conversion to preserve Runcrate’s per-million-token pricing unit.
Also at `web/src/config/ai-models/runcrate.ts:35`, `web/src/config/ai-models/runcrate.ts:51`, `web/src/config/ai-models/runcrate.ts:67`, `web/src/config/ai-models/runcrate.ts:83`, `web/src/config/ai-models/runcrate.ts:100`.
</issue_to_address>
### Comment 2
<location path="web/src/config/llm-providers/runcrate.ts" line_range="5" />
<code_context>
+
+// ref: https://www.runcrate.ai/inference/pricing
+const Runcrate: ModelProviderCard = {
+ chatModels: [],
+ checkModel: 'deepseek-ai/DeepSeek-V4.1-Flash',
+ description: 'Runcrate 提供兼容 OpenAI 的推理 API,可调用 DeepSeek、GLM、Qwen、Kimi、gpt-oss 等开放权重模型。',
</code_context>
<issue_to_address>
**Built-in model metadata stays hidden**
When a user views Runcrate’s built-in model list rather than fetching models from the API, the provider card supplies no chat models, so the built-in provider list cannot display the six models’ context, capability, and pricing metadata; registering those cards in the separate AI-model catalog does not populate this provider card.
Populate the provider card’s `chatModels` from the Runcrate catalog, or connect the catalog to the UI that presents built-in models.
Also at `web/src/config/ai-models/index.ts:99`.
</issue_to_address>
### Comment 3
<location path="web/src/config/llm-providers/runcrate.ts" line_range="7" />
<code_context>
+const Runcrate: ModelProviderCard = {
+ chatModels: [],
+ checkModel: 'deepseek-ai/DeepSeek-V4.1-Flash',
+ description: 'Runcrate 提供兼容 OpenAI 的推理 API,可调用 DeepSeek、GLM、Qwen、Kimi、gpt-oss 等开放权重模型。',
+ disableBrowserRequest: true,
+ id: 'runcrate',
</code_context>
<issue_to_address>
**English users see Chinese description**
`Runcrate.description` is hard-coded in Chinese and is passed through directly by `convertLobeProviderToTemplate`; the added locale entries do not replace it because `getProviderDescription` has no call sites. English users therefore see a Chinese provider description.
Resolve the provider description from the active locale when building or rendering the provider entry instead of storing a single Chinese string.
</issue_to_address>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Runcrate to the built-in LLM provider list of the web console. Runcrate serves an OpenAI-compatible inference API at
https://api.runcrate.ai/v1(/chat/completionswith streaming and tools,/models), so the provider uses the existing OpenAI-compatible request path (sdkType: 'openai') and needs no new client code.Keys are created on the API keys page and look like
rc_live_.... The full model list is on the pricing page.Changes
web/src/config/llm-providers/runcrate.ts: provider card (OpenAI SDK type, model fetcher on, default base URL placeholderhttps://api.runcrate.ai/v1, check modeldeepseek-ai/DeepSeek-V4.1-Flash), registered inllm-providers/index.ts.web/src/config/ai-models/runcrate.ts: six chat models with context window, max output, tool, reasoning and vision flags and pricing in USD per 1M tokens, all read fromGET https://api.runcrate.ai/v1/models: DeepSeek V4.1 Flash, GLM 5.3 Flash, GLM 5.3, Qwen3.8 Flash, gpt-oss 120B, Kimi K2.6. Registered inai-models/index.ts.web/src/config/llm-providers-adapter.ts: default base URL and check model.web/public/icons/providers/runcrate.svg,ProviderIcons.tsx,providerMappings.ts: provider icon.web/src/i18n/locales/{en,zh}/translation.json: provider description.Testing
Run in
web/:pnpm exec tsc: exit 0, no errors.pnpm exec eslint <the 7 touched .ts/.tsx files> --max-warnings 0: exit 0.pnpm build(tsc && vite build): built, exit 0.buncalledllmChatService.sendMessagefor provider idruncratewith a real key and no base URL override, so the URL came fromgetDefaultBaseURL('runcrate').getModelsByProvider('runcrate')returned the six model ids above. Each request went tohttps://api.runcrate.ai/v1/chat/completionswithstream: true:deepseek-ai/DeepSeek-V4.1-Flash: stream completed, reply "pong"zai-org/GLM-5.3-Flash: stream completed, reply "pong"The UI was not opened in a browser.
This PR was prepared with AI assistance: an AI coding agent wrote the change and ran the checks above.
Disclosure: I work on Runcrate.
Summary by Sourcery
Integrate Runcrate into the web console as a fully discoverable OpenAI-compatible LLM provider.
New Features:
Tests: