🦥 Rudra v1 — 4B Coding Agent, Function-Calling & Reasoning LLM (GGUF + Transformers)
Rudra is a 4B coding-agent / reasoning language model built by Vyomma Intelligence. The brain behind Rudra is Ritik Suman from Vyomma Intelligence.
It is a fine-tune of unsloth/Qwen3.5-4B
with QLoRA on Unsloth, trained for coding, agentic tool use, and
reasoning, with an anti-hallucination instruction set.
Runs locally on CPU or a small GPU via Ollama / llama.cpp, or with Transformers. Great for a local coding assistant, function-calling experiments, and agent prototypes.
📦 Files in this repo
| File | Description |
|---|---|
rudra.Q4_K_M.gguf | ✅ The Rudra model — the best fine-tune (beats base on code). This is the file to use. |
rudra-agent-v1.Q4_K_M.gguf | Identical copy of rudra.Q4_K_M.gguf (kept under the explicit rudra-agent-v1 name) |
| Qwen3.5-4B.BF16-mmproj.gguf | Vision projector (llama.cpp multimodal support) |
| Modelfile.native | Ollama Modelfile (Rudra system prompt + agent rules) |
| chat_template.jinja | Custom Rudra chat template (JSON tool_calls format) |
Use rudra.Q4_K_M.gguf — it is the Rudra model (the only variant that beats the base model). rudra.Q4_K_M.gguf and rudra-agent-v1.Q4_K_M.gguf are byte-identical (SHA-256 28537c0cd909e339…).
⚡ TL;DR
# 1. Download the GGUF from this repo (rudra.Q4_K_M.gguf)
# 2. Create an Ollama model from it
ollama create rudra -f Modelfile
ollama run rudra "Plan how to fix a failing pytest suite."
- 🧩 Function calling (JSON
<tool_call>) - 🛠️ Agentic loop: plan → inspect → edit → run → verify → summarize
- 🧠 Reasoning with
[VERIFY]+CONFIDENCE:markers - 🖥️ GGUF Q4_K_M (~2.6 GB) — CPU friendly
- 🔓 Apache-2.0 (base license)
📊 Honest Gap: Base vs. Fine-tunes
5-example quick tests (HumanEval+ execution + BFCL-style function calling), run on the same harness:
| Model | Code pass@1 | Function-calling (name-acc) | Verdict |
|---|---|---|---|
Base qwen-base | 60% (3/5) | 80% (4/5) | Baseline |
rudra (rudra.Q4_K_M.gguf, this repo's main file) | 100% (5/5) | 80% (4/5) | ✅ Beats base on code, ties on FC |
shstra01-mix (mixed-dataset experimental, no longer on HF) | 0% (0/5) | 60% (3/5) | ❌ Regressed — not recommended |
Fresh 2-epoch retrain (rudra-v1, LR 2e-4) | 20% (1/5) | 40% (2/5) | ❌ Regressed — not pushed |
ORPO variant (rudra-orpo) | 0% (0/5) | 20% (1/5) | ❌ Regressed — not pushed |
What was rejected and why
- Mixed-dataset blend (100 examples from Salesforce/xLAM, Glaive, DeepNLP, NVIDIA Nemotron-Agentic): regressed on both code and function calling, and got stuck in an infinite
list_dirthinking loop. Not recommended. - Fresh retrain / ORPO runs: also regressed vs. base under the 6 GB (rank 16, seq 1024) constraint.
Only rudra.Q4_K_M.gguf beats the base model, which is why it is the primary file in this repo.
⚠️ Honest interpretation
Results are from small samples (n=5) — treat as directional, not statistically definitive. Function-calling still depends on the custom JSON tool_calls template, which differs from the base model's native format, so the FC gap vs. proprietary models remains. CONFIDENCE: tags are not fully calibrated.
Recommendation: for production use, rudra.Q4_K_M.gguf is the best available option here; for maximum reliability on code tasks the base Qwen3.5-4B remains competitive.
🚀 Quickstart
Ollama
FROM ./rudra.Q4_K_M.gguf
SYSTEM """Built by vyomma intelligence. Brain behind rudra is ritik suman from vyomma intelligence.
You are Rudra, a coding, agentic and reasoning assistant. Never fabricate facts or outputs; if unsure, say so; end with CONFIDENCE: <high|medium|low>."""
PARAMETER temperature 0.4
PARAMETER num_ctx 8192
ollama create rudra -f Modelfile
ollama run rudra "Write a Python LRU cache."
llama.cpp
llama-cli -m rudra.Q4_K_M.gguf -p "Explain what a list comprehension does."
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("ritiksuman/rudra")
model = AutoModelForCausalLM.from_pretrained("ritiksuman/rudra", device_map="auto")
msgs = [{"role": "system", "content": "Built by vyomma intelligence. Brain behind rudra is ritik suman from vyomma intelligence."},
{"role": "user", "content": "Write a Python function to check for primes."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
print(tok.decode(model.generate(ids.to(model.device), max_new_tokens=256)[0], skip_special_tokens=True))
🧰 Tools (function calling)
| Tool | Purpose |
|---|---|
list_dir(path) | List files/directories |
read_file(path) | Read a file |
write_file(path, content) | Create/overwrite a file |
edit_file(path, old, new) | Replace an exact substring |
run_command(cmd) | Run a shell command |
search_code(pattern) | Search the codebase |
Calls are emitted as:
<tool_call>
{"name": "read_file", "arguments": {"path": "calc.py"}}
</tool_call>
📊 Larger Evaluation (earlier run, directional)
Measured with the harness in the repo (HumanEval+ with real execution; BFCL-style function calling on a held-out xLAM slice; a private set including unanswerable prompts). Small samples — treat as directional.
| Metric | Base Qwen3.5-4B | Rudra |
|---|---|---|
| HumanEval+ pass@1 (n=15) | 40% | 20% |
| Function-calling name acc (n=30) | 96.7% | 56.7% |
| Answerable accuracy (n=6) | 6/6 | 6/6 |
| Decline rate on unanswerable (n=8) | 88% | 62% |
Overconfident (CONFIDENCE: high on unanswerable) | 0% | 50% |
These n=15/n=30 numbers reflect an earlier, weaker fine-tune. The current
rudra.Q4_K_M.ggufimproves code pass@1 to 100% (n=5) over base's 60%.
🏋️ Training
| Setting | Value |
|---|---|
| Base | unsloth/Qwen3.5-4B |
| Method | QLoRA (4-bit), Unsloth |
| LoRA rank | 16 (alpha 16) |
| Epochs | 2 |
| LR | 2e-4 |
| Max seq | 1024 |
| Gradient accumulation | 4 |
| Hardware | NVIDIA RTX 3050 Laptop (6 GB) |
| Data | 338 coding-agent tool trajectories + CodeAlpaca + GSM8K + curated identity/anti-hallucination (rudra_agent_train.jsonl) |
🔬 Reproduce a stronger run
A ready-to-run Kaggle T4 notebook is included in the source project (~32k examples, rank 32, LR 2e-4, 4096 tokens, better datasets: Magicoder-OSS-Instruct, OpenCodeInstruct, xLAM, Hermes, Orca-Math). This is the recommended path to a model that actually beats base at scale.
❓ FAQ
Is it free to run? Yes — GGUF Q4_K_M runs on CPU; no API needed.
Does it need a GPU? No; a small GPU helps.
Context length? Trained at 1024; base supports up to 40,960 — raise num_ctx
in Ollama on bigger hardware.
License? Apache-2.0 (inherited).
Which file should I use? rudra.Q4_K_M.gguf — the only variant that beats base.
🙏 Credits
Fine-tune & tooling by Vyomma Intelligence. Brain behind Rudra: Ritik Suman. Base model: Qwen3.5-4B (Alibaba). Training: Unsloth + TRL.