Text Generation
Transformers
Safetensors
English
qwen2
problem-solve
text-generation-inference
code
math
conversational
Instructions to use prithivMLmods/Draco-CoderMini-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Draco-CoderMini-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Draco-CoderMini-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Draco-CoderMini-3B") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Draco-CoderMini-3B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/Draco-CoderMini-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Draco-CoderMini-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Draco-CoderMini-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Draco-CoderMini-3B
- SGLang
How to use prithivMLmods/Draco-CoderMini-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prithivMLmods/Draco-CoderMini-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Draco-CoderMini-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prithivMLmods/Draco-CoderMini-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Draco-CoderMini-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Draco-CoderMini-3B with Docker Model Runner:
docker model run hf.co/prithivMLmods/Draco-CoderMini-3B
| library_name: transformers | |
| license: apache-2.0 | |
| language: | |
| - en | |
| base_model: | |
| - Qwen/Qwen2.5-3B-Instruct | |
| pipeline_tag: text-generation | |
| tags: | |
| - problem-solve | |
| - text-generation-inference | |
| - code | |
| - math | |
|  | |
| # **Draco-CoderMini-3B** | |
| > **Draco-CoderMini-3B** is a compact, coding-optimized language model built on the **Qwen2 architecture**, tailored for high-accuracy **code generation**, **debugging**, and **technical reasoning**. With **3 billion parameters**, it strikes a balance between power and deployability, making it an ideal assistant for developers, educators, and engineers working in constrained environments or requiring fast inference. | |
| > \[!note] | |
| > GGUF: [https://huggingface.co/prithivMLmods/Draco-CoderMini-3B-GGUF](https://huggingface.co/prithivMLmods/Draco-CoderMini-3B-GGUF) | |
| --- | |
| ## **Key Features** | |
| 1. **Qwen2 Architecture Core** | |
| Built on the robust and scalable **Qwen2** transformer backbone, offering solid performance on both single-turn and multi-step code workflows. | |
| 2. **Code-First Training Focus** | |
| Fine-tuned primarily on coding datasets across Python, JavaScript, C++, and Bash, with additional coverage of software documentation, APIs, and debugging tasks. | |
| 3. **Multi-Step Reasoning in Code** | |
| Capable of breaking down complex programming problems, explaining logic, and correcting bugs—ideal for students, engineers, and software instructors. | |
| 4. **Structured Format Proficiency** | |
| Outputs syntactically correct code blocks, JSON, YAML, and Markdown—streamlining integration into tools, notebooks, and docs. | |
| 5. **Lightweight Yet Powerful** | |
| At 3B parameters, it provides strong results without the heavy resource demands of larger models, and is deployable on most modern GPUs or powerful CPUs. | |
| 6. **Cross-Language Coding Support** | |
| Generates and interprets code in 10+ languages with emphasis on real-world application, scripting, and algorithmic problem-solving. | |
| --- | |
| ## **Quickstart with Transformers** | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_name = "prithivMLmods/Draco-CoderMini-3B" | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_name, | |
| torch_dtype="auto", | |
| device_map="auto" | |
| ) | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| prompt = "Write a Python function to check if a number is prime." | |
| messages = [ | |
| {"role": "system", "content": "You are a helpful coding assistant."}, | |
| {"role": "user", "content": prompt} | |
| ] | |
| text = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| model_inputs = tokenizer([text], return_tensors="pt").to(model.device) | |
| generated_ids = model.generate( | |
| **model_inputs, | |
| max_new_tokens=512 | |
| ) | |
| generated_ids = [ | |
| output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) | |
| ] | |
| response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] | |
| print(response) | |
| ``` | |
| --- | |
| ## **Intended Use** | |
| * Code generation, translation, and refactoring | |
| * Teaching and tutoring in programming concepts | |
| * Technical documentation generation and API auto-fill | |
| * Debugging assistant with error analysis and fixes | |
| * Lightweight deployment in IDEs, coding platforms, and offline environments | |
| --- | |
| ## **Limitations** | |
| * Smaller context length compared to larger coding models (e.g., >7B) | |
| * May require prompt engineering for deeply nested or obscure code patterns | |
| * Limited fluency in non-programming natural language dialogue | |
| * Not optimized for purely creative writing or storytelling tasks | |
| --- | |
| ## **References** | |
| 1. [Qwen2.5 Technical Report](https://arxiv.org/pdf/2412.15115) | |
| 2. [YaRN: Efficient Context Window Extension of Large Language Models](https://arxiv.org/pdf/2309.00071) |