Text Generation
Transformers
GGUF
English
text-generation-inference
ollama
qwen3
python-coding
conversational
Instructions to use truss-ai/truss-qwen3-python-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use truss-ai/truss-qwen3-python-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="truss-ai/truss-qwen3-python-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("truss-ai/truss-qwen3-python-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use truss-ai/truss-qwen3-python-lora with 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
- LM Studio
- Jan
- vLLM
How to use truss-ai/truss-qwen3-python-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "truss-ai/truss-qwen3-python-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "truss-ai/truss-qwen3-python-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/truss-ai/truss-qwen3-python-lora
- SGLang
How to use truss-ai/truss-qwen3-python-lora 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 "truss-ai/truss-qwen3-python-lora" \ --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": "truss-ai/truss-qwen3-python-lora", "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 "truss-ai/truss-qwen3-python-lora" \ --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": "truss-ai/truss-qwen3-python-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use truss-ai/truss-qwen3-python-lora with Ollama:
ollama run hf.co/truss-ai/truss-qwen3-python-lora
- Unsloth Studio
How to use truss-ai/truss-qwen3-python-lora 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 truss-ai/truss-qwen3-python-lora 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 truss-ai/truss-qwen3-python-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for truss-ai/truss-qwen3-python-lora to start chatting
- Pi
How to use truss-ai/truss-qwen3-python-lora with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf truss-ai/truss-qwen3-python-lora
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "truss-ai/truss-qwen3-python-lora" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use truss-ai/truss-qwen3-python-lora with Docker Model Runner:
docker model run hf.co/truss-ai/truss-qwen3-python-lora
- Lemonade
How to use truss-ai/truss-qwen3-python-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull truss-ai/truss-qwen3-python-lora
Run and chat with the model
lemonade run user.truss-qwen3-python-lora-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use truss-ai/truss-qwen3-python-lora with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf truss-ai/truss-qwen3-python-lora
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default truss-ai/truss-qwen3-python-lora
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use truss-ai/truss-qwen3-python-lora with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf truss-ai/truss-qwen3-python-lora
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "truss-ai/truss-qwen3-python-lora" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
File size: 2,930 Bytes
e936bdd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | ---
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.* |