Truss Python: Qwen3-4B Specialized Coding Assistant
Truss Python is a specialized fine-tuned version of Qwen3-4B-Instruct-2507, optimized for generating clean, professional, and robust Python code. By focusing on high-quality seed prompts involving standard libraries, asynchronous programming, and data structures, this model prioritizes type safety, documentation, and modern Pythonic patterns.
🚀 Model Details
- Base Model: Qwen/Qwen3-4B-Instruct-2507
- Architecture: Qwen3ForCausalLM
- Fine-Tuning Method: LoRA (Low-Rank Adaptation)
- Quantization: Q4_K_M (GGUF)
- File Size: ~2.5 GB
- License: Apache 2.0 (Inherited from Qwen3)
✨ Key Features
- Professional Structure: Consistently generates code with Google-style docstrings and comprehensive type hints.
- Modern Syntax: Proficient in Python 3.10+ features like
match-casestructural pattern matching. - Robust Error Handling: Prioritizes
try/exceptblocks and resource management (e.g.,async with,contextlib). - Standard Library Focus: Expert-level knowledge of
asyncio,threading,csv,functools, andpandas.
💻 Usage with Ollama
This model is optimized for local deployment using Ollama.
1. Local Import (Using GGUF)
If you have downloaded the .gguf file:
- Create a
Modelfile:FROM ./truss-qwen3-python-lora.gguf PARAMETER temperature 0.2 SYSTEM "You are an expert Python developer. Provide clean, efficient, and well-documented code." - Create the model in your terminal:
ollama create truss-python -f Modelfile - Run the model:
ollama run truss-python
🧪 Example Prompts
| Task | Prompt |
|---|---|
| Algorithms | "Write a binary search function with type hints and no built-in libraries." |
| Decorators | "Create a @timer decorator using functools.wraps and time.perf_counter." |
| Async I/O | "Fetch data from 3 URLs concurrently using aiohttp and asyncio.gather." |
| Data Science | "Optimize a pandas merge for 1M+ rows using specific dtypes." |
⚙️ Technical Specifications
| Parameter | Value |
|---|---|
| Parameters | 4 Billion |
| Context Length | 262,144 tokens |
| Embedding Dim | 2,560 |
| Head Count | 32 (Q), 8 (KV) |
| RoPE Theta | 5,000,000 |
📜 License
This model is based on Qwen3, which is licensed under the Apache 2.0 License. The fine-tuned weights and GGUF conversion are provided for research and development purposes.
Built with ❤️ using Unsloth, llama.cpp, and Ollama.