Instructions to use squ11z1/gpt-oss-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use squ11z1/gpt-oss-nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="squ11z1/gpt-oss-nano") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("squ11z1/gpt-oss-nano") model = AutoModelForCausalLM.from_pretrained("squ11z1/gpt-oss-nano") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use squ11z1/gpt-oss-nano with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="squ11z1/gpt-oss-nano", filename="gpt-oss-9b-bf16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use squ11z1/gpt-oss-nano with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf squ11z1/gpt-oss-nano:Q4_K_M # Run inference directly in the terminal: llama-cli -hf squ11z1/gpt-oss-nano:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf squ11z1/gpt-oss-nano:Q4_K_M # Run inference directly in the terminal: llama-cli -hf squ11z1/gpt-oss-nano:Q4_K_M
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 squ11z1/gpt-oss-nano:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf squ11z1/gpt-oss-nano:Q4_K_M
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 squ11z1/gpt-oss-nano:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf squ11z1/gpt-oss-nano:Q4_K_M
Use Docker
docker model run hf.co/squ11z1/gpt-oss-nano:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use squ11z1/gpt-oss-nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "squ11z1/gpt-oss-nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "squ11z1/gpt-oss-nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/squ11z1/gpt-oss-nano:Q4_K_M
- SGLang
How to use squ11z1/gpt-oss-nano 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 "squ11z1/gpt-oss-nano" \ --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": "squ11z1/gpt-oss-nano", "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 "squ11z1/gpt-oss-nano" \ --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": "squ11z1/gpt-oss-nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use squ11z1/gpt-oss-nano with Ollama:
ollama run hf.co/squ11z1/gpt-oss-nano:Q4_K_M
- Unsloth Studio new
How to use squ11z1/gpt-oss-nano 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 squ11z1/gpt-oss-nano 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 squ11z1/gpt-oss-nano to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for squ11z1/gpt-oss-nano to start chatting
- Pi new
How to use squ11z1/gpt-oss-nano with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf squ11z1/gpt-oss-nano:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "squ11z1/gpt-oss-nano:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use squ11z1/gpt-oss-nano with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf squ11z1/gpt-oss-nano:Q4_K_M
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 squ11z1/gpt-oss-nano:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use squ11z1/gpt-oss-nano with Docker Model Runner:
docker model run hf.co/squ11z1/gpt-oss-nano:Q4_K_M
- Lemonade
How to use squ11z1/gpt-oss-nano with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull squ11z1/gpt-oss-nano:Q4_K_M
Run and chat with the model
lemonade run user.gpt-oss-nano-Q4_K_M
List all available models
lemonade list
(New release: try my latest quantum cutting-edge model — Hypnos-Q1)
GPT-OSS-Nano
Compact Reasoning Model with Mixture of Experts
9B parameters • 12 experts • 128K context • Chain-of-thought reasoning
📋 Model Description
GPT-OSS-Nano is a fine-tuned Mixture of Experts (MoE) language model optimized for step-by-step reasoning and problem solving. Built on the GPT-OSS architecture with sparse expert activation, it achieves strong reasoning performance while using only ~3B active parameters per forward pass.
✨ Key Features
| Feature | Description |
|---|---|
| 🧠 Sparse MoE | 12 experts, 4 active per token — efficient compute |
| 📝 Chain-of-Thought | Fine-tuned on reasoning datasets with step-by-step solutions |
| ⚡ 128K Context | Long context with YaRN rope scaling |
| 🔮 Q-GPT Ready | Compatible with quantum confidence estimation |
| 📦 GGUF Available | Run locally with llama.cpp or Ollama |
🏗️ Architecture
┌─────────────────────────────────────────────────────────┐
│ GPT-OSS-Nano │
├─────────────────────────────────────────────────────────┤
│ Total Parameters │ 9.0 Billion │
│ Active Parameters │ ~3 Billion (per forward pass) │
│ Hidden Dimension │ 2880 │
│ Attention Heads │ 64 (8 KV heads, GQA) │
│ Layers │ 24 │
│ Experts │ 12 total, 4 active │
│ Context Length │ 131,072 tokens │
│ Vocabulary Size │ 201,088 │
│ Precision │ BFloat16 │
└─────────────────────────────────────────────────────────┘
💻 Usage
Quick Start with Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"squ11z1/gpt-oss-nano",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"squ11z1/gpt-oss-nano",
trust_remote_code=True,
)
prompt = """Solve this step by step:
A store offers 20% off on all items. If a jacket costs $85,
what is the final price after discount?"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
⚡ With Unsloth (2x Faster)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"squ11z1/gpt-oss-nano",
dtype=None,
load_in_4bit=True, # 4-bit quantization for efficiency
)
# For inference
FastLanguageModel.for_inference(model)
📦 With GGUF (llama.cpp)
# Download the quantized model
wget https://huggingface.co/squ11z1/gpt-oss-nano/resolve/main/gpt-oss-9b-q4_k_m.gguf
# Run inference
./llama-cli -m gpt-oss-9b-q4_k_m.gguf \
-p "Solve step by step: What is 15% of 240?" \
-n 256 --temp 0.7
🦙 With Ollama
# Create Modelfile
echo 'FROM ./gpt-oss-9b-q4_k_m.gguf' > Modelfile
ollama create gpt-oss-nano -f Modelfile
# Run
ollama run gpt-oss-nano "Explain quantum computing simply"
🎓 Training
Training Details
| Parameter | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Method | QLoRA (4-bit quantized LoRA) |
| LoRA Rank | 32 |
| LoRA Alpha | 32 |
| Learning Rate | 2e-4 |
| Batch Size | 2 (gradient accumulation: 8) |
| Epochs | 2 |
| Framework | Unsloth + TRL |
| Hardware | NVIDIA H200 |
Dataset: Superior-Reasoning — chain-of-thought examples with step-by-step problem solving.
🔮 Q-GPT: Quantum Confidence
GPT-OSS-Nano is compatible with Q-GPT — a quantum neural network that estimates response confidence.
from q_gpt import load_qgpt
model, tokenizer = load_qgpt("squ11z1/gpt-oss-nano")
outputs = model.generate_with_confidence(inputs, max_new_tokens=256)
print(f"Response confidence: {outputs['confidence_label']}")
# Output: "high", "moderate", "low", etc.
if outputs['should_refuse']:
print("⚠️ Model is uncertain — consider refusing to answer")
Learn more: squ11z1/Q-GPT
⚠️ Limitations
- Language: Primarily optimized for English; multilingual performance varies
- Hallucinations: May generate plausible but incorrect information on obscure topics
- Safety: Not designed for safety-critical applications without validation
- Math: Strong at arithmetic reasoning; weaker on advanced mathematics
📜 License
This model is released under the Apache 2.0 License.
🙏 Acknowledgments
- Unsloth — 2x faster fine-tuning
- OpenAI — GPT-OSS base model
- llama.cpp — GGUF format and quantization
📖 Citation
@misc{gptossnano2026,
title={GPT-OSS-Nano: Compact MoE Reasoning Model},
author={squ11z1},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/squ11z1/gpt-oss-nano}
}
Pro Mundi Vita
- Downloads last month
- 2,337
