Instructions to use micymike/codemate-qwen-1.5B-8k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use micymike/codemate-qwen-1.5B-8k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="micymike/codemate-qwen-1.5B-8k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("micymike/codemate-qwen-1.5B-8k") model = AutoModelForMultimodalLM.from_pretrained("micymike/codemate-qwen-1.5B-8k") 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 micymike/codemate-qwen-1.5B-8k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "micymike/codemate-qwen-1.5B-8k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "micymike/codemate-qwen-1.5B-8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/micymike/codemate-qwen-1.5B-8k
- SGLang
How to use micymike/codemate-qwen-1.5B-8k 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 "micymike/codemate-qwen-1.5B-8k" \ --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": "micymike/codemate-qwen-1.5B-8k", "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 "micymike/codemate-qwen-1.5B-8k" \ --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": "micymike/codemate-qwen-1.5B-8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use micymike/codemate-qwen-1.5B-8k with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for micymike/codemate-qwen-1.5B-8k to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for micymike/codemate-qwen-1.5B-8k to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for micymike/codemate-qwen-1.5B-8k to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="micymike/codemate-qwen-1.5B-8k", max_seq_length=2048, ) - Docker Model Runner
How to use micymike/codemate-qwen-1.5B-8k with Docker Model Runner:
docker model run hf.co/micymike/codemate-qwen-1.5B-8k
CodeMate-Qwen-1.5B-8k 🚀
CodeMate-Qwen-1.5B-8k is a multi-turn, conversational coding assistant built on top of micymike/codemate-qwen-1.5B.
This iteration specifically resolves two critical limitations found in the previous model: it expands the core Context Window to 8,192 tokens using dynamic RoPE scaling, and it completely eliminates the prompt-repetition bug using targeted completion-only loss masking during Supervised Fine-Tuning (SFT).
Model Improvements 🛠️
- Extended Token Window: Upgraded from 2,048 tokens to 8,192 tokens, allowing it to read massive source code files and retain memory across deep, back-and-forth chat debug sessions.
- Prompt Echoing Fixed: Trained natively using Hugging Face TRL's
completion_only_loss=True. The model no longer mimics or repeats user instructions before outputting code. - Bug-Fixing Specialization: Fine-tuned on multi-turn code repair paths (
iamtarun/code_instructions_120k_alpaca), teaching the model how to isolate programming syntax bugs, explain the root issues, and provide production-ready solutions without forgetting its baseline Python and ReactJS knowledge.
Chat Prompt Format (ChatML) 📝
This model utilizes the standard ChatML prompt template structure. To prevent hallucination or parsing drops, structure your inference payloads like this:
<|im_start|>user
[Your Python or React coding/debugging prompt goes here]<|im_end|>
<|im_start|>assistant
Quickstart with Transformers 🐍
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "micymike/codemate-qwen-1.5B-8k"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "user", "content": "Fix the bug in this React code where the state hook updates infinitely."}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=1024, do_sample=True, temperature=0.3)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Acknowledgements 🎓
Special thanks to the Unsloth AI framework for enabling memory-efficient 8k attention matrix mapping directly inside standard consumer GPU runtimes.
- Downloads last month
- 62