Instructions to use khazarai/Qwen3.5-4B-Agentic-Coding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khazarai/Qwen3.5-4B-Agentic-Coding with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="khazarai/Qwen3.5-4B-Agentic-Coding") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("khazarai/Qwen3.5-4B-Agentic-Coding") model = AutoModelForMultimodalLM.from_pretrained("khazarai/Qwen3.5-4B-Agentic-Coding", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khazarai/Qwen3.5-4B-Agentic-Coding with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khazarai/Qwen3.5-4B-Agentic-Coding" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/Qwen3.5-4B-Agentic-Coding", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/khazarai/Qwen3.5-4B-Agentic-Coding
- SGLang
How to use khazarai/Qwen3.5-4B-Agentic-Coding 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 "khazarai/Qwen3.5-4B-Agentic-Coding" \ --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": "khazarai/Qwen3.5-4B-Agentic-Coding", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "khazarai/Qwen3.5-4B-Agentic-Coding" \ --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": "khazarai/Qwen3.5-4B-Agentic-Coding", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use khazarai/Qwen3.5-4B-Agentic-Coding with Docker Model Runner:
docker model run hf.co/khazarai/Qwen3.5-4B-Agentic-Coding
Qwen3.5-4B-Agentic-Coding
Model Summary
Qwen3.5-4B-Agentic-Coding is a fine-tuned, 4-billion parameter language model optimized for agentic coding tasks, structured technical reasoning, and automated tool interaction. Built upon the Qwen3.5 architecture, this model excels at multi-step problem solving, refactoring codebases without logic gaps, and seamlessly executing tool calls (Bash, Python, File Editor, Browser).
Unlike general-purpose models that may produce loose code syntax or lose track of historical code patterns during refactoring, Qwen3.5-4B-Agentic-Coding maintains a strict internal chain of thought to preserve execution correctness (e.g., accurately demonstrating legacy Callback-to-Async transformations).
Intended Use
Primary Use Cases
- Agentic Coding Assistants: Autonomous software development agents using external tool execution.
- Code Refactoring & Optimization: Transforming legacy paradigms (e.g., callback hell) into modern asynchronous or modular paradigms with strict logical checks.
- Structured Technical Reasoning: Explaining architectural decisions and step-by-step logic before generating executable output.
- Interactive Tool Execution: Generating structured commands for environments supporting Bash, Python, or file operations.
Out-of-Scope / Non-Recommended Use
- Non-English programming inquiries or multi-lingual conversational tasks.
- Direct deployment in production without human-in-the-loop validation for critical code infrastructure.
Training Dataset & Tools
The model was fine-tuned on a high-quality dataset designed to boost agentic problem-solving capabilities.
Integrated Dataset Tools
| Tool | Purpose |
|---|---|
editor |
File creation, updating, and repository-wide modifications. |
bash |
Executing terminal commands and managing execution pipelines. |
python |
In-line code validation, sandboxed testing, and mathematical checks. |
browser |
Real-time technical documentation lookup and validation. |
Strengths & Behavioral Characteristics
- Precise Problem Framing: Validates legacy structures before refactoring, preventing logical contradictions (such as confusing Promises with Callbacks).
- Minimal Injected Friction: Keeps core implementations clean and standalone without adding unnecessary, non-functional code abstractions.
- Structured System Thought: Embeds step-by-step reasoning blocks (
<think>) prior to code delivery for complete transparency.
Limitations & Biases
- Synthetically Generated: The fine-tuning dataset relies on synthetic distillation techniques, which may occasionally echo systemic patterns from the teacher models.
- Language Restriction: Optimizations are strictly centered around English code annotations and prompt instructions.
- Model Biases: Inherits standard biases from the core Qwen3.5 architecture.othai/unsloth)
- Downloads last month
- 192