Downloads · 30 days
53
15% of all-time downloads
distil-labs/Distil-Localdoc-Qwen3-0.6B
Distil-Localdoc-Qwen3-0.6B is a text generation model from distil-labs. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<div align="center" <img src="https://github.com/distil-labs/badges/blob/main/distillabs-logo.svg?raw=true" width="40%" alt="distil labs" / </div
Downloads · 30 days
53
15% of all-time downloads
All-time downloads
343
Public
Repo size
2.4 GB
Likes
3
Public
Click a slice to open those files.
.gguf2.4 GB · 100%
From the Hugging Face model README
A small language model (SLM) fine-tuned by Distil Labs for generating high-quality Python docstrings in Google style. Optimized to run locally via Ollama, ensuring your proprietary code never leaves your infrastructure.
*********** GITHUB DEMO AND CODE ***********
Given Python functions or methods without docstrings, the model generates complete, properly formatted documentation following Google style guide.
Before:
def calculate_total(items, tax_rate=0.08, discount=None):
subtotal = sum(item['price'] * item['quantity'] for item in items)
if discount:
subtotal *= (1 - discount)
return subtotal * (1 + tax_rate)
After:
def calculate_total(items, tax_rate=0.08, discount=None):
"""
Calculate the total cost of items, applying a tax rate and optionally a discount.
Args:
items: List of item objects with price and quantity
tax_rate: Tax rate expressed as a decimal (default 0.08)
discount: Discount rate expressed as a decimal; if provided, the subtotal is multiplied by (1 - discount)
Returns:
Total amount after applying the tax
Example:
>>> items = [{'price': 10, 'quantity': 2}, {'price': 5, 'quantity': 1}]
>>> calculate_total(items, tax_rate=0.1, discount=0.05)
22.5
"""
subtotal = sum(item['price'] * item['quantity'] for item in items)
if discount:
subtotal *= (1 - discount)
return subtotal * (1 + tax_rate)
The model handles:
Privacy & Security: Proprietary codebases contain intellectual property and trade secrets. Cloud APIs create:
Speed & Cost: Document entire codebases in minutes without API rate limits or per-token charges.
The tuned model was trained using knowledge distillation, leveraging the teacher model GPT-OSS-120B. We used 28 diverse Python functions and classes as seed data and supplemented them with 10,000 synthetic examples covering various domains:
Training data includes examples with:
We evaluated the model on 250 held-out test examples using LLM-as-a-judge methodology to assess the overall quality of generated docstrings.
| Model | Size | Accuracy |
|---|---|---|
| GPT-OSS (thinking) | 120B | 0.81 ± 0.02 |
| Qwen3 0.6B (tuned) | 0.6B | 0.76 ± 0.01 |
| Qwen3 0.6B (base) | 0.6B | 0.55 ± 0.04 |
The fine-tuned model achieves 94% of the teacher model's performance while running entirely on local hardware with zero API costs and complete privacy.
Follow the instructions in the Github repository
Quick start:
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Download and build the model
pip install huggingface_hub
hf download distil-labs/Distil-Localdoc-Qwen3-0.6B --local-dir distil-model
cd distil-model
ollama create localdoc_qwen3 -f Modelfile
# Run on your code
python localdoc_cli.py --file your_script.py
# Basic usage (generates Google-style docstrings)
python localdoc_cli.py --file my_module.py
# Use specific model
python localdoc_cli.py --file my_module.py --model localdoc_qwen3
The tool will:
_documented suffix@software{distil_localdoc_2024,
title = {Distil-Localdoc: Local Python Documentation Generation with SLMs},
author = {Distil Labs},
year = {2024},
url = {https://huggingface.co/distil-labs/Distil-Localdoc-Qwen3-0.6B}
}