How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf truss-ai/truss-qwen3-python-lora
# Run inference directly in the terminal:
llama cli -hf truss-ai/truss-qwen3-python-lora
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf truss-ai/truss-qwen3-python-lora
# Run inference directly in the terminal:
llama cli -hf truss-ai/truss-qwen3-python-lora
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf truss-ai/truss-qwen3-python-lora
# Run inference directly in the terminal:
./llama-cli -hf truss-ai/truss-qwen3-python-lora
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf truss-ai/truss-qwen3-python-lora
# Run inference directly in the terminal:
./build/bin/llama-cli -hf truss-ai/truss-qwen3-python-lora
Use Docker
docker model run hf.co/truss-ai/truss-qwen3-python-lora
Quick Links

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-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:
    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:
    ollama create truss-python -f Modelfile
    
  3. 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.

Downloads last month
-
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for truss-ai/truss-qwen3-python-lora

Quantized
(295)
this model