r/coolgithubprojects • u/btwiamR3X • 24m ago
HybridCoder: local Qwen does the coding, cloud models only step in when it gets stuck, so you spend far fewer API tokens.
Small local coding models (I use qwen2.5-coder:7b on a 6 GB laptop GPU) handle routine work but struggle with larger multi-file tasks and with fixing their own failures. Cloud models handle those well, but running everything through them burns API credits.
HybridCoder splits the work so each model does what it's good at:
- Cloud models plan and rescue. For architectural or cross-module tasks, a cloud model (NVIDIA NIM by default, Gemini as fallback) writes the plan. If the local model's fix still fails its tests after two attempts, one cloud repair gets the diff and the exact error.
- The local model does the bulk of the work. Qwen via Ollama writes the code, applies the edits, and makes the repair attempts. Small fixes and routine coding never leave your machine.
- Verification keeps it honest. Edits are exact search/replace patches, checked before writing. Related tests (or a frontend build) run after each change, and failures feed back into the loop.
- Cloud models are swappable. Model IDs, API keys, and endpoints are configured in
.envor the settings panel. You can change the Gemini or NVIDIA model, or point the cloud provider at any OpenAI-compatible endpoint, without touching the code.
The goal is cloud-level capability on hard tasks, with the token-heavy generation done locally so API usage stays limited to planning and the occasional repair.
Results so far: On a 20-task benchmark of small Python bugs, 17 of 20 passed an independent pytest run. Local Qwen made 13 repair attempts and only 4 tasks needed a cloud repair. These are small isolated tasks, so I'm not claiming it generalizes to big repos, and I haven't yet measured token savings against a cloud-only run.
Stack: FastAPI backend, React UI, Ollama, Gemini, NVIDIA NIM. Windows 10/11, Python 3.11+, Node 18+. Cloud keys are optional, so it also runs fully local.
GitHub: https://github.com/RiteshNipane/HybridCoder
Feedback welcome on the routing and repair logic.

