feat: experimental keyless CLI backend with auto-fallback and ASR fallback#11
feat: experimental keyless CLI backend with auto-fallback and ASR fallback#11dull-bird wants to merge 4 commits into
Conversation
…me video analysis - Add core/llm_cli.py: drive Claude Code as an LLM backend via session-resume multi-turn and a text tool-call protocol. Activated by R2S_LLM_BACKEND=cli. - Wire dispatch in core/llm.py so call_azure_openai and call_llm route to the CLI backend without changing any call sites. - Add core/analyzer_cli_video.py: R2S_VIDEO_BACKEND=cli analyzes YouTube videos using yt-dlp subtitles + ffmpeg keyframes instead of Gemini. - Make google-genai import lazy in core/analyzer.py so the CLI video path can run without the Gemini SDK installed. - Add skill/Resource2Skill/SKILL.md connector for agents to drive cli.py. - Update README.md and .env.example with no-API-key setup instructions.
- Detect locally installed agent CLIs (claude, codex, kimi, omp) and default R2S_LLM_BACKEND=cli when AZURE_OPENAI_API_KEY is absent. - Default R2S_VIDEO_BACKEND=cli when GEMINI_API_KEY is absent so video analysis uses yt-dlp subtitles + ffmpeg keyframes without configuration. - Update skill/Resource2Skill/SKILL.md with discovery/retrieval instructions and explain the skill.json format. - Update README no-key section with the new auto-fallback behavior.
|
@microsoft-github-policy-service agree |
- Add _download_audio, _run_asr, and helpers to core/analyzer_cli_video.py. - Support R2S_VIDEO_ASR=auto|faster-whisper|whisper and R2S_VIDEO_ASR_MODEL. - Fallback only triggers after yt-dlp reports no native VTT subtitles. - Benchmark: faster-whisper tiny is ~5x faster than openai-whisper tiny on a 60s clip (3.9s vs 20.6s) at comparable quality. - Update README, .env.example, and SKILL.md with the new env variables and limitations.
There was a problem hiding this comment.
Hi @dull-bird,
Thanks for contributing and sharing this keyless CLI path with the project. After narrowing the review, I think there are only two core issues to address before merge:
-
core/llm_cli.py: isolate conversations. Sessions are identified only from the first two messages, so two independent identical runs can reuse the same Claude session, with the second run sent asContinue.. Please scope the session to each run or use an explicit conversation identity. -
The fallback should respect an explicitly supplied Gemini key. In
core/analyzer.pyandcore/llm.py, backend selection checks theGEMINI_API_KEYenvironment variable but can ignore a valid per-callapi_key=value and route the request to the CLI backend instead. Please include the explicit key when deciding whether fallback is needed.
One minor item: skill/Resource2Skill/SKILL.md currently fails the standard skill validator. Removing the unsupported author field and using a lowercase hyphen-case name should resolve it.
Thanks again for providing this contribution and making the work available to the community. Once these items are updated, I’ll take another pass.
|
Thanks for taking a look. I've pushed the fixes to I addressed three items:
Verified with |
Summary
This PR adds an experimental, opt-in way to run Resource2Skill without Azure OpenAI or Gemini API keys by using locally authenticated agent CLIs (currently Claude Code) as the LLM backend, and by analyzing YouTube videos from yt-dlp subtitles + ffmpeg keyframes instead of Gemini native video understanding.
It now also auto-detects the keyless path when API keys are missing, and falls back to local ASR when a video has no native subtitles.
Changes
Verification
Scope / Limitations
Backward Compatibility
Default behavior is unchanged. Users can explicitly set "R2S_LLM_BACKEND=cli" and/or "R2S_VIDEO_BACKEND=cli" to use the new paths, or leave keys unset and let the system auto-fallback when a local CLI is available.