Skip to content

feat(llm): add Runcrate as a named OpenAI-compatible provider - #228

Open
heydryft wants to merge 2 commits into
modelscope:mainfrom
heydryft:feat/runcrate-provider
Open

heydryft wants to merge 2 commits into
modelscope:mainfrom
heydryft:feat/runcrate-provider

Conversation

@heydryft

@heydryft heydryft commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary

  • Adds Runcrate as a named OpenAI-compatible LLM provider, in the same shape as the Cheaper Inference and OrcaRouter routes (feat(llm): add Cheaper Inference as a named OpenAI-compatible gateway #223, feat(llm): add OrcaRouter as a named OpenAI-compatible gateway #205).
  • funclip/llm/openai_api.py: a runcrate/ prefix that is stripped before the request (model ids keep their vendor, e.g. deepseek-ai/DeepSeek-V4.1-Flash), base URL https://api.runcrate.ai/v1 (overridable with RUNCRATE_API_BASE), key from the APIKEY box or RUNCRATE_API_KEY, never OPENAI_API_KEY.
  • funclip/launch.py: runcrate in SUPPORT_LLM_PREFIX, the runcrate/ route to openai_call, and two dropdown entries: runcrate/deepseek-ai/DeepSeek-V4.1-Flash and runcrate/openai/gpt-oss-120b.
  • README and README_zh: a short "Using Runcrate" section next to the other providers.
  • tests/test_runcrate_launch_integration.py: launcher dispatch, prompt roles and vendor-qualified dropdown ids (added in 37daeda after review).
  • tests/test_runcrate_api.py: base URL, prefix stripping, env key, RUNCRATE_API_BASE override, empty model, and no fallback to the OpenAI key.

User impact

Users can run LLM-assisted clipping on open models through Runcrate. Runcrate has a free allowance on some open models, with the limits in its free inference terms; usage beyond it is paid.

Validation

  • I ran the relevant tests or commands: pytest tests/test_runcrate_api.py tests/test_cheaperinference_api.py tests/test_orcarouter_api.py tests/test_minimax_api.py tests/test_openai_api.py tests/test_*_launch_integration.py tests/test_model_selection.py: 39 passed.
  • I checked the affected README/docs links, if changed.
  • I verified the affected UI, API, ASR, LLM, or clipping path, if changed: live openai_call("", "runcrate/<model>", <prompt + SRT>, demo_prompt) with RUNCRATE_API_KEY set and no OpenAI variables. Both deepseek-ai/DeepSeek-V4.1-Flash and openai/gpt-oss-120b returned a segment in the 1. [start-end] text format that the AI Clip step parses.

Notes for reviewers

Disclosure: I work on Runcrate. This PR was prepared with AI assistance (an AI coding agent wrote the change and ran the tests and the live check above).

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the five-file diff at 4c3073a and the actual shared API/launcher implementation.

The five added Runcrate tests and 26 existing related provider/launcher regressions passed independently on Python 3.12 with OpenAI SDK 2.44.0 and external socket connections denied. These are offline mocked-client/AST checks, not a live provider or full Gradio/AI Clip acceptance. A separate four-case real-SDK/mock-transport check produced passing JUnit/log output, but its wrapper failed to capture the child exit code; it is not counted as a complete process receipt.

Before merging, please address:

  1. The English and Chinese README statements that open models are free with a GitHub account omit material conditions. The official free-inference terms specify account eligibility, shared session/week allowances and capacity limits, with paid fallback when a workspace has credit. Please use neutral wording linking to these conditions, rather than implying unrestricted free clipping. A canonical link without campaign tracking is preferable.
  2. Please attach the already-run live-check evidence described in the PR: exact head/dependency versions, date, both model IDs, a small synthetic SRT/prompt, and redacted response/parsed segment results. Do not include credentials or private recordings. Existing evidence is sufficient; no need to repeat successful calls just for this review. I have not made provider calls or incurred charges.
  3. Please retain a Runcrate launcher regression in the repository, covering its dispatch and prompt roles as well as the vendor-qualified model IDs. The new tests cover openai_call directly but would not catch loss of the new launcher route. Existing providers already have corresponding launcher tests.

The prefix/key isolation and vendor preservation worked in the checked offline cases. This review is about the documented cost boundary, durable launcher coverage, and evidence for the claimed live path; it is not a request for another administrator to approve.

@heydryft

heydryft commented Nov 1, 2026

Copy link
Copy Markdown
Author

Thanks for the careful review. All three points are addressed in 37daeda.

1. README wording. Both READMEs now link the canonical pages with no campaign parameters (https://www.runcrate.ai/inference) and say: "Runcrate has a free allowance on some open models, with eligibility, usage and capacity limits described in its free inference terms; usage beyond the allowance is paid." README_zh.md says the same in Chinese.

2. Live-check evidence. I didn't keep a record of the original check, so I reran it once at 4c3073a (the Runcrate code is unchanged in 37daeda; only README and tests changed), 2026-11-01 10:12 UTC, Python 3.12.13, openai 2.54.0. openai_call("", "runcrate/<model>", user + "\n" + srt, system) with RUNCRATE_API_KEY set and no OPENAI_* variables, using the launcher's default Chinese system and user prompts and this synthetic SRT:

1
00:00:00,000 --> 00:00:04,000
Welcome to the weekly product update.

2
00:00:04,000 --> 00:00:09,500
The biggest news is that exports are now three times faster.

3
00:00:09,500 --> 00:00:13,000
Next, a quick note about the office move.

Responses, then extract_timestamps() on each:

  • runcrate/deepseek-ai/DeepSeek-V4.1-Flash: 1. [00:00:00-00:00:09,500] Welcome to the weekly product update. The biggest news is that exports are now three times faster. gives [], because the model left the milliseconds off the start time. A run a few minutes earlier with a short English prompt gave 2. [00:00:04,000-00:00:09,500] The biggest news is that exports are now three times faster., which matches the parser.
  • runcrate/openai/gpt-oss-120b: 1. [00:00:00,000-00:00:13,000] Welcome to the weekly product update. The biggest news is that exports are now three times faster. Next, a quick note about the office move. gives [[0, 13000]].

So the route, prefix stripping and key isolation work for both models. Whether a reply matches the strict HH:MM:SS,mmm timestamp format depends on the model, the same as for the other OpenAI-compatible providers. I kept the two dropdown entries as they are, but I can drop the DeepSeek one if you would rather list only gpt-oss.

3. Launcher regression. New tests/test_runcrate_launch_integration.py, in the same shape as the Cheaper Inference, MiniMax and OrcaRouter launcher tests. It checks that the branch returning openai_call(...) covers model.startswith('runcrate/') and passes apikey, model, user_content + '\n' + srt_text and system_content in that order; that runcrate is in SUPPORT_LLM_PREFIX; and that the dropdown keeps the vendor-qualified ids runcrate/deepseek-ai/DeepSeek-V4.1-Flash and runcrate/openai/gpt-oss-120b. Removing the runcrate/ condition from launch.py makes the dispatch test fail (checked locally, then restored).

Tests on 37daeda, Python 3.12:
python -m pytest -q tests/test_runcrate_api.py tests/test_runcrate_launch_integration.py tests/test_cheaperinference_api.py tests/test_orcarouter_api.py tests/test_minimax_api.py tests/test_openai_api.py tests/test_cheaperinference_launch_integration.py tests/test_minimax_launch_integration.py tests/test_orcarouter_launch_integration.py tests/test_model_selection.py tests/test_installation_docs.py: 47 passed.

I wrote this follow-up and the new test with AI assistance (omp with Claude). The test runs and the live calls above were run while preparing it.

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