--- license: apache-2.0 language: - en tags: - text-generation-inference - transformers - gguf - ollama - qwen3 - python-coding base_model: Qwen/Qwen3-4B-Instruct-2507 pipeline_tag: text-generation --- # 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](https://huggingface.co/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-case` structural pattern matching. * **Robust Error Handling:** Prioritizes `try/except` blocks and resource management (e.g., `async with`, `contextlib`). * **Standard Library Focus:** Expert-level knowledge of `asyncio`, `threading`, `csv`, `functools`, and `pandas`. ## ๐Ÿ’ป Usage with Ollama This model is optimized for local deployment using **Ollama**. ### 1. Local Import (Using GGUF) If you have downloaded the `.gguf` file: 1. Create a `Modelfile`: ```dockerfile FROM ./truss-qwen3-python-lora.gguf PARAMETER temperature 0.2 SYSTEM "You are an expert Python developer. Provide clean, efficient, and well-documented code." ``` 2. Create the model in your terminal: ```bash ollama create truss-python -f Modelfile ``` 3. Run the model: ```bash 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.*