|
|
--- |
|
|
library_name: transformers |
|
|
tags: |
|
|
- code |
|
|
- coding-assistant |
|
|
- qwen2 |
|
|
- lora |
|
|
- fine-tuned |
|
|
- full-stack |
|
|
- reasoning |
|
|
license: apache-2.0 |
|
|
language: |
|
|
- en |
|
|
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
# 🇮🇳 IndraCoder — AI Coding Assistant |
|
|
|
|
|
A fine-tuned coding LLM built on **Qwen2.5-Coder-1.5B-Instruct**, trained on 4 curated datasets for code generation, debugging, algorithmic reasoning, and agentic tool use. |
|
|
|
|
|
## ✨ Highlights |
|
|
|
|
|
- 🧠 **Chain-of-thought reasoning** — Uses `<think>` blocks to reason before coding |
|
|
- 🔧 **Full-stack development** — Python, JavaScript, TypeScript, React, FastAPI, and more |
|
|
- 🛠️ **Tool/function calling** — Trained on agentic tool-use patterns |
|
|
- 📦 **Lightweight** — 1.5B parameters, runs on consumer GPUs |
|
|
|
|
|
## Quick Start |
|
|
|
|
|
```python |
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
|
|
|
|
model = AutoModelForCausalLM.from_pretrained("RockySinghRajput/Indracoder", torch_dtype="auto", device_map="auto") |
|
|
tokenizer = AutoTokenizer.from_pretrained("RockySinghRajput/Indracoder") |
|
|
|
|
|
messages = [ |
|
|
{"role": "system", "content": "You are IndraCoder, an expert AI coding assistant."}, |
|
|
{"role": "user", "content": "Write a Python function to find the longest palindromic substring."} |
|
|
] |
|
|
|
|
|
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) |
|
|
inputs = tokenizer([text], return_tensors="pt").to(model.device) |
|
|
|
|
|
output = model.generate(inputs.input_ids, max_new_tokens=512, temperature=0.7, top_p=0.9) |
|
|
print(tokenizer.decode(output[0][len(inputs.input_ids[0]):], skip_special_tokens=True)) |
|
|
``` |
|
|
|
|
|
## Model Details |
|
|
|
|
|
| Property | Value | |
|
|
|----------|-------| |
|
|
| **Base Model** | [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) | |
|
|
| **Parameters** | 1.5B | |
|
|
| **Type** | Causal Language Model (merged LoRA fine-tune) | |
|
|
| **Language** | English | |
|
|
| **License** | Apache 2.0 | |
|
|
| **Developed by** | [RockySinghRajput](https://huggingface.co/RockySinghRajput) | |
|
|
|
|
|
## Training Details |
|
|
|
|
|
### Training Data |
|
|
|
|
|
Fine-tuned on **4 curated datasets** (~8,000 samples): |
|
|
|
|
|
| Dataset | Purpose | Samples | |
|
|
|---------|---------|---------| |
|
|
| [glaive-code-assistant-v3](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v3) | General code generation & debugging | ~2,000 | |
|
|
| [evol-codealpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1) | Hard algorithmic problems | ~2,000 | |
|
|
| [CodeFeedback-Filtered](https://huggingface.co/datasets/m-a-p/CodeFeedback-Filtered-Instruction) | Code reasoning & explanations | ~2,000 | |
|
|
| [glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2) | Agentic tool/function calling | ~2,000 | |
|
|
|
|
|
### Training Procedure |
|
|
|
|
|
- **Method**: LoRA (Low-Rank Adaptation) → merged into base model |
|
|
- **LoRA Config**: r=16, alpha=16, dropout=0.05 |
|
|
- **Target Modules**: q_proj, k_proj, v_proj, o_proj |
|
|
- **Epochs**: 1 |
|
|
- **Batch Size**: 1 (gradient accumulation: 4, effective batch: 4) |
|
|
- **Learning Rate**: 1e-4 (cosine schedule) |
|
|
- **Optimizer**: paged_adamw_8bit |
|
|
- **Sequence Length**: 512 tokens |
|
|
- **Precision**: FP16 mixed precision |
|
|
- **Quantization**: 4-bit NF4 (QLoRA) during training |
|
|
|
|
|
### Compute Infrastructure |
|
|
|
|
|
- **Hardware**: NVIDIA T4 GPU |
|
|
- **Training Time**: ~1 hour |
|
|
|
|
|
## Capabilities |
|
|
|
|
|
### ✅ What IndraCoder Can Do |
|
|
|
|
|
- **Write code** in Python, JavaScript, TypeScript, Java, C++, Go, Rust |
|
|
- **Debug code** — find and fix bugs with explanations |
|
|
- **Explain code** — break down complex code step by step |
|
|
- **Algorithm design** — data structures, dynamic programming, graphs |
|
|
- **Full-stack development** — React, FastAPI, Express, databases |
|
|
- **Tool/function calling** — structured function calls for agentic workflows |
|
|
|
|
|
### ⚠️ Limitations |
|
|
|
|
|
- **1.5B model** — smaller than GPT-4, Claude, or larger open-source models |
|
|
- **Not suitable** for complex multi-file refactoring or very long code generation |
|
|
- **English only** — not trained on multilingual data |
|
|
- **No image/file understanding** — text-only model |
|
|
- **May hallucinate** — always review generated code before using in production |
|
|
|
|
|
### ❌ Out-of-Scope Use |
|
|
|
|
|
- Production code without human review |
|
|
- Security-critical applications without expert validation |
|
|
- Medical, legal, or financial advice |
|
|
- Generating malicious code or exploits |
|
|
|
|
|
## Evaluation |
|
|
|
|
|
Tested on 4 qualitative benchmarks: |
|
|
|
|
|
| Test | Task | Result | |
|
|
|------|------|--------| |
|
|
| Full-Stack | REST API with auth in FastAPI | ✅ Generates working code | |
|
|
| Algorithm | Implement LRU Cache O(1) | ✅ Correct approach | |
|
|
| Debug | Fix React infinite re-render | ✅ Identifies useEffect issue | |
|
|
| Tool Use | Chain function calls for file analysis | ✅ Correct tool selection | |
|
|
|
|
|
> **Note**: These are qualitative assessments, not standardized benchmarks. |
|
|
|
|
|
## Citation |
|
|
|
|
|
```bibtex |
|
|
@misc{indracoder2025, |
|
|
title={IndraCoder: A Fine-tuned Coding LLM}, |
|
|
author={RockySinghRajput}, |
|
|
year={2025}, |
|
|
publisher={HuggingFace}, |
|
|
url={https://huggingface.co/RockySinghRajput/Indracoder} |
|
|
} |
|
|
``` |
|
|
|
|
|
## Contact |
|
|
|
|
|
- **HuggingFace**: [RockySinghRajput](https://huggingface.co/RockySinghRajput) |
|
|
|