Instructions to use OsamaBinLikhon/NextStep-Coder-MoE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use OsamaBinLikhon/NextStep-Coder-MoE with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("distilgpt2") model = PeftModel.from_pretrained(base_model, "OsamaBinLikhon/NextStep-Coder-MoE") - Transformers
How to use OsamaBinLikhon/NextStep-Coder-MoE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OsamaBinLikhon/NextStep-Coder-MoE")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OsamaBinLikhon/NextStep-Coder-MoE", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OsamaBinLikhon/NextStep-Coder-MoE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OsamaBinLikhon/NextStep-Coder-MoE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsamaBinLikhon/NextStep-Coder-MoE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OsamaBinLikhon/NextStep-Coder-MoE
- SGLang
How to use OsamaBinLikhon/NextStep-Coder-MoE 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 "OsamaBinLikhon/NextStep-Coder-MoE" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsamaBinLikhon/NextStep-Coder-MoE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "OsamaBinLikhon/NextStep-Coder-MoE" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsamaBinLikhon/NextStep-Coder-MoE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OsamaBinLikhon/NextStep-Coder-MoE with Docker Model Runner:
docker model run hf.co/OsamaBinLikhon/NextStep-Coder-MoE
NextStep-Coder-MoE
A high-performance tiny coding LLM with Interleaved Thinking capability for advanced reasoning and agentic workflows.
Model Description
NextStep-Coder-MoE is a LoRA fine-tuned model based on Qwen2.5-Coder-1.5B, optimized for:
- Chain-of-Thought reasoning with
<think>...</think>tags - Multi-step coding tasks
- Agentic workflows (plan โ act โ reflect)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load model
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B")
model = PeftModel.from_pretrained(base_model, "OsamaBinLikhon/NextStep-Coder-MoE")
tokenizer = AutoTokenizer.from_pretrained("OsamaBinLikhon/NextStep-Coder-MoE")
# Generate
prompt = "Write a Python function to check if a number is prime.\n<think>"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0]))
Training Details
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-Coder-1.5B |
| Method | LoRA (r=16, alpha=32) |
| Trainable Params | 18.4M (1.18%) |
| Precision | bf16 |
| Framework | Transformers + PEFT |
Interleaved Thinking Format
The model uses <think> tags to show reasoning:
User: Write a binary search function.
Model: <think>
I need to implement binary search on a sorted array.
Key steps: find middle, compare, narrow search space.
Edge case: empty array returns -1.
</think>
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
Intended Use
- Code generation with step-by-step reasoning
- Debugging and code review
- Algorithm design and explanation
- Educational coding assistance
Limitations
- Best for Python, may vary for other languages
- Requires
<think>tag retention in conversation history - 2048 token context limit
Author
OsamaBinLikhon
License
Apache 2.0
Framework versions
- PEFT 0.18.0
- Downloads last month
- -
Model tree for OsamaBinLikhon/NextStep-Coder-MoE
Base model
distilbert/distilgpt2