ayjays132's picture
Upload 478 files
101858b verified
---
license: mit
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
library_name: transformers
tags:
- code
- qwen
- guidance
- sidecar
- orchestration
---
# Qwen Coder Guidance Sidecar
This bundle describes a lightweight local coding guidance component for larger model orchestration. It is upload-ready as a Hugging Face model/runtime adapter package. It does not include training data.
It uses `Qwen/Qwen2.5-Coder-1.5B-Instruct` as a fast sidecar that returns compact JSON guidance instead of final user-facing prose. The larger model can call it before or during implementation to get route decisions, repo facts, patch constraints, risks, and tests.
## Output Contract
```json
{
"route": "plan|patch|critique|test|fix",
"confidence": 0.0,
"useful_context": ["short facts the outer model should keep"],
"plan": ["ordered implementation steps"],
"patch_rules": ["constraints for the patch"],
"risks": ["likely bugs or failure modes"],
"tests": ["commands or cases to run"],
"next_action": "one concise next action"
}
```
## Runtime
- Default model: `Qwen/Qwen2.5-Coder-1.5B-Instruct`
- Included local model path: `base_model/`
- Recommended inference: 4-bit NF4, bf16 compute, CUDA
- Cache behavior: disk cache by request hash
- Memory behavior: unload after call by default
- Package entrypoint: `guidance_sidecar.GuidanceEngine`
- Deterministic tools: route hint, context stats, risk scan, test suggestions, patch rules, simple calculations, Python syntax probe
## Use
Run directly from the uploaded/downloaded folder:
```bash
python run_guidance.py --task "Plan a safe config-loader refactor" --context "Python package with tests."
```
Or use the included modeling wrapper:
```python
from modeling_guidance_sidecar import GuidanceSidecar
guide = GuidanceSidecar("./qwen-coder-guidance-sidecar")
result = guide("Refactor the config loader safely", context="Python package with tests.")
```
The repo also includes the full `guidance_sidecar/` runtime package, so it can be used without installing the source project separately.
## Larger-Model Route
1. Outer model gathers repo context.
2. Sidecar runs deterministic tools and Qwen guidance.
3. Sidecar returns compact JSON with `tool_signals`.
4. Outer model treats that JSON as internal control data.
5. Outer model patches code, runs tests, and may call sidecar again for critique/fix routing.
The sidecar is designed to help a larger model, not replace it.