Skip to content

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

Open
aiapienthusiast wants to merge 1 commit into
modelscope:mainfrom
aiapienthusiast:cheaperinference-provider
Open

aiapienthusiast wants to merge 1 commit into
modelscope:mainfrom
aiapienthusiast:cheaperinference-provider

Conversation

@aiapienthusiast

Copy link
Copy Markdown

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.

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.

1 participant