Instructions to use layer8labs8/OrdoPy-Coder-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use layer8labs8/OrdoPy-Coder-0.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="layer8labs8/OrdoPy-Coder-0.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("layer8labs8/OrdoPy-Coder-0.5B") model = AutoModelForCausalLM.from_pretrained("layer8labs8/OrdoPy-Coder-0.5B", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use layer8labs8/OrdoPy-Coder-0.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "layer8labs8/OrdoPy-Coder-0.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "layer8labs8/OrdoPy-Coder-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/layer8labs8/OrdoPy-Coder-0.5B
- SGLang
How to use layer8labs8/OrdoPy-Coder-0.5B 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 "layer8labs8/OrdoPy-Coder-0.5B" \ --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": "layer8labs8/OrdoPy-Coder-0.5B", "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 "layer8labs8/OrdoPy-Coder-0.5B" \ --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": "layer8labs8/OrdoPy-Coder-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use layer8labs8/OrdoPy-Coder-0.5B with Docker Model Runner:
docker model run hf.co/layer8labs8/OrdoPy-Coder-0.5B
OrdoPy-Coder-0.5B
OrdoPy-Coder-0.5B is a compact 0.5B parameter specialist model tuned on Qwen/Qwen2.5-Coder-0.5B-Instruct exclusively for Python programming, English instruction following, and step-by-step logical reasoning.
Focusing the full capacity of the 0.5B backbone on a single coherent skill cluster (English + Logic + Verified Python) delivers strong functional code execution accuracy while remaining fast and deployable in < 1.5 GB VRAM (float16).
Official Execution Benchmarks (Pass@1 โ 421 Tasks)
Evaluated greedily (do_sample=False) inside isolated 3.0s-timeout sys.executable -I subprocesses against full unit-test suites (openai/openai_humaneval 164 tasks + google-research-datasets/mbpp sanitized 257 test tasks):
| Benchmark Suite | Baseline (Qwen2.5-Coder-0.5B-Instruct) |
OrdoPy-Coder-0.5B |
Gain |
|---|---|---|---|
HumanEval (164 tasks) |
9.76% (16/164) |
40.85% (67/164) |
+31.09% (4.19x) |
MBPP Sanitized Test (257 tasks) |
36.58% (94/257) |
46.30% (119/257) |
+9.72% (+25 tasks) |
Combined (421 tasks) |
26.13% (110/421) |
44.18% (186/421) |
+18.05% (+76 tasks) |
Official EvalPlus Suite (evalplus Greedy Pass@1)
| Benchmark Suite | OrdoPy-Coder-0.5B Pass@1 |
Passed Tasks |
|---|---|---|
HumanEval (base) |
48.8% (0.4878) |
80 / 164 |
HumanEval+ (base + extra tests) |
46.3% (0.4634) |
76 / 164 |
MBPP (base) |
48.4% (0.4841) |
183 / 378 |
MBPP+ (base + extra tests) |
42.1% (0.4206) |
159 / 378 |
Held-Out Domain Evaluation
| Domain (Held-Out Split) | Baseline Loss (PPL / Token Acc) | OrdoPy-Coder-0.5B Loss (PPL / Token Acc) |
|---|---|---|
python_code (MBPP Sanitized Val) |
1.0226 (2.78 / 76.44%) |
0.9843 (2.68 / 78.40%) |
logic_math (GSM8K Official Test) |
1.4752 (4.37 / 73.21%) |
1.4096 (4.09 / 74.68%) |
english_debug (Alpaca Held-Out) |
1.6227 (5.07 / 59.53%) |
1.4409 (4.22 / 61.58%) |
Model Details
- Architecture:
Qwen2ForCausalLM(24layers,hidden_size=896,494Mparameters,32Kcontext window) - Base Model:
Qwen/Qwen2.5-Coder-0.5B-Instruct - Specialization: Python code generation, algorithmic problem solving, debugging & step-by-step reasoning in English
- Format: Safetensors (
model.safetensors) + Qwen ChatML tokenizer template
Quickstart Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "layer8labs8/OrdoPy-Coder-0.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.float16, device_map="auto"
)
messages = [
{
"role": "system",
"content": (
"You are OrdoPy, an expert Python software engineer and logical problem solver. "
"Think clearly step-by-step in English and write clean, bug-free Python code."
),
},
{
"role": "user",
"content": "Write a Python function `is_palindrome_clean(s: str) -> bool` ignoring spaces and punctuation.",
},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
- Downloads last month
- 54
Model tree for layer8labs8/OrdoPy-Coder-0.5B
Base model
Qwen/Qwen2.5-0.5B