Skip to content

feat(llm): add Cheaper Inference as a named OpenAI-compatible gateway - #223

Merged
LauraGPT merged 1 commit into
modelscope:mainfrom
aiapienthusiast:cheaperinference-provider
Oct 8, 2026
Merged

LauraGPT merged 1 commit into
modelscope:mainfrom
aiapienthusiast:cheaperinference-provider

Conversation

@aiapienthusiast

Copy link
Copy Markdown
Contributor

Summary

  • This PR adds Cheaper Inference as a named OpenAI-compatible gateway for LLM clipping.
  • It uses the same pattern as feat(llm): add OrcaRouter as a named OpenAI-compatible gateway #205 (OrcaRouter) and Add Atlas Cloud LLM option #181 (Atlas Cloud).
  • Cheaper Inference is an OpenAI-compatible LLM gateway. One API key gives access to models from several labs.
  • Select a cheaperinference/ model in LLM Model Name, paste the key in APIKEY, and click 'LLM Inference'.
  • CHEAPER_INFERENCE_API_KEY and optional CHEAPER_INFERENCE_API_BASE also work.

User impact

Users with a Cheaper Inference key can run LLM clipping without code changes.
FunClip removes the cheaperinference/ prefix and sends the bare model id, like atlascloud/ and minimax/.
Other providers do not change.

Details

Files:

  • funclip/llm/openai_api.py: base URL, prefix, and env key in _resolve_model_config.
  • funclip/launch.py: prefix list, openai_call route, and 4 dropdown models.
  • README.md, README_zh.md: short optional section after OrcaRouter.
  • tests/test_cheaperinference_api.py, tests/test_cheaperinference_launch_integration.py: same cases as the OrcaRouter tests.

Live check: gpt-5.4-mini returned a reply through openai_call(..., "cheaperinference/gpt-5.4-mini", ...).

Validation

  • I ran the relevant tests or commands:
    • python -m pytest -q tests/test_github_templates.py tests/test_funasr_requirement.py tests/test_installation_docs.py tests/test_openai_api.py tests/test_cheaperinference_api.py tests/test_cheaperinference_launch_integration.py tests/test_orcarouter_api.py tests/test_orcarouter_launch_integration.py tests/test_minimax_api.py tests/test_minimax_launch_integration.py: 40 passed
    • python -m pytest -q tests/test_gradio_runtime_compat.py tests/test_installation_docs.py tests/test_cli_stage_help.py (gradio 4.44.1): 14 passed
    • python3 -m py_compile funclip/launch.py funclip/videoclipper.py funclip/utils/subtitle_utils.py: pass
    • git diff --check: clean
  • I checked the affected README/docs links, if changed.
  • I verified the affected UI, API, ASR, LLM, or clipping path, if changed.

Screenshots or clips

No screenshots. The UI change adds 4 entries to the existing LLM model dropdown. I tested the LLM call path, not a full video clip.

Notes for reviewers

Dropdown models: gpt-5.4-mini, gpt-5.4, claude-sonnet-5, deepseek-v4-flash. Other model ids also work with the cheaperinference/ prefix.

@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 8469e38fb8203d01df26f7f41cbfd21dcb80d501. No blocking regression found in the changed gateway routing.

I independently ran the new provider tests together with the existing OpenAI, OrcaRouter and MiniMax routing/launcher tests: 26 passed. An additional 9 boundary cases passed, executing the actual llm_inference function extracted from the launcher and the actual client wrapper with recording doubles. These checked all four dropdown models plus a custom model, preservation of the system prompt and combined user prompt/subtitles, explicit-key precedence, whitespace/empty base-URL handling, environment-key trimming, and omission of an empty system prompt.

The provider's public documentation confirms https://api.cheaperinference.com/v1 for the OpenAI-compatible client and bare model IDs. Its GPT-5.4 Mini page also shows the bare ID in a chat-completions example. The other model choices appear in the provider's documentation or linked model catalogue.

The checks use mocked completions and execute the launcher function without loading the full Gradio app. I did not repeat the paid live request or a video-clipping/UI run, so these results establish the local routing contract rather than live provider availability or clipping quality.

@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.

The local routing checks and published provider documentation are covered in review #5451920150. The previously approval-held Tests workflow (37007022772) has now completed successfully.

@LauraGPT
LauraGPT merged commit 36acf72 into modelscope:main Oct 8, 2026
1 check passed
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