Call gpt-oss-20b Free on Groq
Groq hosts openai/gpt-oss-20b on its permanent no-card free tier at 30 RPM, 1,000 RPD and 8,000 TPM — making it one of the highest-allowance free coding and agent APIs available today. Point the standard OpenAI SDK at Groq's endpoint using model ID openai/gpt-oss-20b and your free GROQ_API_KEY.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.groq.com/openai/v1",
api_key=os.environ["GROQ_API_KEY"],
)
r = client.chat.completions.create(
model="openai/gpt-oss-20b",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: "https://api.groq.com/openai/v1",
apiKey: process.env.GROQ_API_KEY,
maxRetries: 0,
});
const r = await client.chat.completions.create({
model: "openai/gpt-oss-20b",
messages: [{ role: 'user', content: "Hello" }],
});
console.log(r.choices[0].message.content);# Pull native MXFP4 weights (~14.3 GB total at 8K context)
ollama run gpt-oss:20bWhy 20.9B Total and 3.6B Active Matters
OpenAI's gpt-oss-20b is a 20.9B-parameter Mixture-of-Experts (MoE) model under Apache 2.0 that activates only 3.6B parameters per token. That sparse MoE design delivers fast token generation comparable to a 3B–4B dense model while retaining the reasoning, coding and tool-calling capability of a 20B checkpoint — and its compact 24-layer, 64 head_dim KV cache uses just 0.047 MB per token.
Many developers assume a 3.6B-active Mixture-of-Experts model only needs 4 GB of VRAM. That is a common trap: the router can select any expert on any token, so all 20.9B parameters must stay loaded in GPU VRAM or unified memory. The payoff is speed — each forward pass computes only 3.6B parameters, giving you 20B-class reasoning at small-model latency, while its 24-layer, 64 head_dim KV cache adds just 0.047 MB per token.
Run Native MXFP4 Weights in Ollama and LM Studio
Ollama supports OpenAI's native MXFP4 weights directly via ollama run gpt-oss:20b (~14.3 GB at 8K context), fitting cleanly on a 16 GB RTX 4060 Ti / RTX 4080 or 24 GB Mac mini. You can also load gpt-oss-20b GGUF builds in LM Studio and llama.cpp.
Memory Needed per Quantization
| Quantization | Weights | Total at 8K | Fits on |
|---|---|---|---|
| FP16 | 41.8 GB | 44.9 GB | Mac Studio 128GB, Mac Studio 64GB |
| Q4_K_M | 12.7 GB | 14.3 GB | Mac mini 24GB, Mac Studio 128GB, Mac Studio 64GB, RTX 4060 Ti 16GB, RTX 4090, RTX 5090 |
| Q5_K_M | 14.9 GB | 16.6 GB | Mac mini 24GB, Mac Studio 128GB, Mac Studio 64GB, RTX 4090, RTX 5090 |
| Q8_0 | 22.2 GB | 24.3 GB | Mac Studio 128GB, Mac Studio 64GB, RTX 5090 |
Apache 2.0 Commercial Freedom
Permissive Apache 2.0 license allowing commercial deployment, fine-tuning and redistribution without user-count caps. Read the official license at huggingface.co/openai/….