Text / WORKFLOW

Extract structured data locally with gpt-oss 20B

Extract and validate a sample receipt with gpt-oss 20B through local Ollama and Python.

EstimatedSource checked 9/29/2026
LOCALRENTED GPU
Freshness 17 out of 100. Repository age: 461 days old, Aug 4, 2025. Measures age, not quality.
Popularity 92 out of 100. 5,927,863 downloads in 30 days; 5,283 lifetime likes. Checked Nov 7, 2026. Measures adoption, not quality.
Arena Open Source Text: rank 110 of 228. Ranked model: gpt-oss-20b. Original model ranking, not a benchmark of this package. Export dated Nov 6, 2026. Source checked Nov 7, 2026. Human preference ranking, not hardware suitability.
Category rankings & sources

Each position belongs to a separate Arena category. These are human preference rankings—not hardware recommendations. We do not combine the categories into one score.

Text#110of 228 open models
gpt-oss-20bopenaiLicense: Apache 2.0

Original model ranking. This does not benchmark the selected quantization or package.

Export dated Nov 6, 2026Checked: Nov 7, 2026Overall board: #270
View official Text board

Rankings reflect the dated export; live Arena boards can change. Open-source positions use Arena’s open-model filter. The overall position also includes the other models on that category board. Availability of weights and license terms still need to be checked separately.

What do these scores mean?

Two ways to compare models. Neither score measures answer quality, benchmark performance, or whether a model fits your machine.

Freshness · release age

A new release starts at 100. The score halves every 180 days: 100 × 2^(−age in days / 180). When the release date is unavailable, a repository date is a fallback—not proof of when the model was released. Missing dates stay unscored.

Check the date source
Popularity · adoption

Downloads over the past 30 days carry 80% of the score; lifetime likes carry 20%. Both use a logarithmic scale, capped at 10 million downloads and 100,000 likes. If likes are unavailable, downloads carry all the weight. Missing download statistics stay unscored.

round(80 × min(1, log10(1 + downloads) / 7) + 20 × min(1, log10(1 + likes) / 5))

Check the statistics source
Scores as of Nov 8, 2026. Statistics checked Nov 7, 2026. Statistics are marked for refresh after 72 hours.Full scoring method

Before you begin

Hardware

Estimates for the 14.0 GB Ollama package at 4K text context. A full GPU load needs room beyond the weight download for runtime and KV cache; CPU offload can run on smaller GPUs with enough system RAM, but responds more slowly.

Machinegpt-oss · 20B
NVIDIA GPU · 8 GBUse CPU offload with 32 GB RAM; slow.
NVIDIA GPU · 12 GBUse CPU offload with 32 GB RAM; slow.
NVIDIA GPU · 16 GBRuns at 4K text context; limited headroom.
NVIDIA GPU · 24 GBRuns at 4K with headroom; speed not tested.
NVIDIA GPU · 32 GBRuns at 4K with headroom; speed not tested.
AMD Radeon · 8 GBUse CPU offload with 32 GB RAM; slow. Confirm the Ollama GPU backend with ollama ps.
AMD Radeon · 16 GBRuns at 4K text context; limited headroom. Confirm the Ollama GPU backend with ollama ps.
AMD Radeon · 24 GBRuns at 4K with headroom; speed not tested. Confirm the Ollama GPU backend with ollama ps.
AMD Radeon · 32 GBRuns at 4K with headroom; speed not tested. Confirm the Ollama GPU backend with ollama ps.
Intel Arc · 8 GBUse CPU offload with 32 GB RAM; slow. Confirm the Ollama GPU backend with ollama ps.
Intel Arc · 16 GBRuns at 4K text context; limited headroom. Confirm the Ollama GPU backend with ollama ps.
Intel Arc · 24 GBRuns at 4K with headroom; speed not tested. Confirm the Ollama GPU backend with ollama ps.
Intel Arc · 32 GBRuns at 4K with headroom; speed not tested. Confirm the Ollama GPU backend with ollama ps.
Apple Silicon · 16 GB unifiedNeeds more unified memory at 4K; use a 24 GB Mac or lower-memory model.
Apple Silicon · 24 GB unifiedRuns at 4K text context; limited memory headroom.
Apple Silicon · 32 GB unifiedRuns at 4K text context with room to raise context; speed not tested.
Apple Silicon · 64 GB unifiedRuns at 4K text context with room to raise context; speed not tested.
CPU-only · 16 GB RAMBelow the 32 GB system-RAM starting point; choose a smaller model.
CPU-only · 32 GB RAMCan run in system RAM at 4K; expect slower replies than GPU.
CPU-only · 64 GB RAMCan run in system RAM at 4K; expect slower replies than GPU.

These are memory-fit starting points, not performance tests. Check the exact AMD or Intel Ollama backend and use ollama ps to see the GPU/CPU split; longer context or image input needs more memory.

LOCAL EXTRACTION / OLLAMASOURCE-LINKED SETUP

Turn a receipt into validated local JSON.

Install gpt-oss 20B through Ollama, run a small Python extractor, and compare every returned field to the original receipt. Choose the Windows, Mac, or Linux route.

Choose a package Run its commands Check the result
01
BEFORE YOU BEGIN

The documented package

This setup uses the package documented for this task. Review its source and supported platforms before starting.

Save your machine in My Hardware to get an automatic starting choice. You can always choose any package yourself.

CURRENT SETUP

gpt-oss · 20B · official

The 14 GB Ollama package needs additional memory for runtime and 4K context; start with 16 GB GPU or 24 GB Apple Silicon unified memory. The Python validator is small but not a substitute for model memory.

Freshness 17 out of 100. Repository age: 461 days old, Aug 4, 2025. Measures age, not quality.
Popularity 92 out of 100. 5,927,863 downloads in 30 days; 5,283 lifetime likes. Checked Nov 7, 2026. Measures adoption, not quality.
Arena Open Source Text: rank 110 of 228. Ranked model: gpt-oss-20b. Original model ranking, not a benchmark of this package. Export dated Nov 6, 2026. Source checked Nov 7, 2026. Human preference ranking, not hardware suitability.
Category rankings & sources

Each position belongs to a separate Arena category. These are human preference rankings—not hardware recommendations. We do not combine the categories into one score.

Text#110of 228 open models
gpt-oss-20bopenaiLicense: Apache 2.0

Original model ranking. This does not benchmark the selected quantization or package.

Export dated Nov 6, 2026Checked: Nov 7, 2026Overall board: #270
View official Text board

Rankings reflect the dated export; live Arena boards can change. Open-source positions use Arena’s open-model filter. The overall position also includes the other models on that category board. Availability of weights and license terms still need to be checked separately.

What do these scores mean?

Two ways to compare models. Neither score measures answer quality, benchmark performance, or whether a model fits your machine.

Freshness · release age

A new release starts at 100. The score halves every 180 days: 100 × 2^(−age in days / 180). When the release date is unavailable, a repository date is a fallback—not proof of when the model was released. Missing dates stay unscored.

Check the date source
Popularity · adoption

Downloads over the past 30 days carry 80% of the score; lifetime likes carry 20%. Both use a logarithmic scale, capped at 10 million downloads and 100,000 likes. If likes are unavailable, downloads carry all the weight. Missing download statistics stay unscored.

round(80 × min(1, log10(1 + downloads) / 7) + 20 × min(1, log10(1 + likes) / 5))

Check the statistics source
Scores as of Nov 8, 2026. Statistics checked Nov 7, 2026. Statistics are marked for refresh after 72 hours.Full scoring method
View weight source
02
THE WORKFLOW

Set up gpt-oss · 20B on your machine

Choose where you want to run it. The instructions below update to match your selection.

CHOOSE YOUR SETUPMac

Use Terminal on Apple Silicon. Ollama for macOS is available from the official download page.

02

Check the runtime and Python

In Terminal, confirm Ollama and Python 3 are available. Install Python 3 first if python3 is not found.

Install Python 3
ollama --version python3 --version
03

Download gpt-oss:20b

Pull the exact package before running the example, so model download failures are separate from Python errors.

ollama pull gpt-oss:20b
04

Install the local Python libraries

The official Ollama Python client connects to the service on your own machine. Pydantic checks the output schema.

python3 -m pip install --upgrade ollama pydantic
05

Create extract.py

In Terminal, paste this block. It writes the complete small example as extract.py in your current folder. Read the code before running it.

cat > extract.py <<'PY' from ollama import chat from pydantic import BaseModel class Item(BaseModel): name: str price: float class Receipt(BaseModel): store: str items: list[Item] source = "Corner Cafe receipt: Coffee $3.00, Tea $2.00." response = chat( model="gpt-oss:20b", messages=[{"role": "user", "content": "Extract only the store and items from this receipt: " + source}], format=Receipt.model_json_schema(), options={"temperature": 0}, ) receipt = Receipt.model_validate_json(response.message.content) print(receipt.model_dump_json(indent=2)) assert receipt.store == "Corner Cafe", "Store differs from source; inspect manually" assert {(item.name, item.price) for item in receipt.items} == {("Coffee", 3.0), ("Tea", 2.0)}, "Items differ from source; inspect manually" print("Checked against the sample receipt") PY
06

Run and validate the sample receipt

Run the script. Pydantic validates the shape and the two assertions check every sample value against the receipt text.

python3 extract.py
07

Check the JSON and placement

Look for Corner Cafe, Coffee 3.0 and Tea 2.0 plus the checked message. If an assertion fails, inspect the JSON against the source; do not silently accept wrong fields. Use ollama ps to see CPU/GPU placement.

ollama ps
03
SUCCESS CHECK · gpt-oss · 20B

Validated receipt JSON

The script prints Corner Cafe, Coffee 3.0, Tea 2.0 and “Checked against the sample receipt.” Its assertions compare each field with the sample text; valid JSON alone is not enough.

This is a local text example, not a test of document scanning or factual accuracy on unknown receipts. Review ambiguous fields manually and do not send private receipts to a hosted endpoint.

Back to setup steps

When it doesn’t go to plan

JSON validation raises an error.

Check the Ollama package is gpt-oss:20b, the format argument uses Receipt.model_json_schema(), and Pydantic is installed. Inspect the raw model response before changing the schema.

JSON shape passes but a receipt assertion fails.

Compare each returned value with the original sample. Lower context or simplify the prompt, then manually correct ambiguous data; a valid schema does not prove correctness.

The model is too slow or spills into CPU RAM.

Run ollama ps to inspect placement, close other GPU apps, then use a 24 GB GPU or 32 GB Mac for more headroom.

REFERENCE LIBRARY

Sources and files

Original instructions, model files, and compatibility notes behind this setup.

4 SOURCES

The model behind this workflow

gpt-oss · 20B

Keep exploring

Text
SETUP GUIDE

Qwen3.5 · 9B private chat setup

Source-backed package and platform-route plan for private local chat with Qwen3.5 · 9B. Preserves the official Ollama 9B package, a smaller 4B family fallback, and a clearly labeled community uncensored GGUF option.

Freshness 38 out of 100. Release age: 254 days old, Feb 27, 2026. Measures age, not quality.
Popularity 91 out of 100. 6,321,700 downloads in 30 days; 2,329 lifetime likes. Checked Nov 7, 2026. Measures adoption, not quality.
SOFTWAREOllama
Coding
SETUP GUIDE

Build a private coding assistant with Qwen3.8 27B

Run Qwen3.8 27B with Ollama, connect it to Cline in VS Code, and make one reviewable code change in a tiny local project.

Freshness 69 out of 100. Repository age: 95 days old, Aug 5, 2026. Measures age, not quality.
Popularity 96 out of 100. 7,813,215 downloads in 30 days; 19,312 lifetime likes. Checked Nov 7, 2026. Measures adoption, not quality.
Arena Open Source Web coding: rank 12 of 62. Ranked model: Qwen3.8-27B. Original model ranking, not a benchmark of this package. Export dated Nov 6, 2026. Source checked Nov 7, 2026. Human preference ranking, not hardware suitability.+3
SOFTWAREOllama + Visual Studio Code + Cline + Python
Images
SETUP GUIDE

Create images locally with FLUX.2 Klein

Generate images from text prompts in ComfyUI with the fast distilled or more adjustable base 4B model. Save your results and reuse the visual workflow.

Freshness 32 out of 100. Release age: 297 days old, Jan 15, 2026. Measures age, not quality.
Popularity 77 out of 100. 435,063 downloads in 30 days; 1,097 lifetime likes. Checked Nov 7, 2026. Measures adoption, not quality.
SOFTWAREComfyUI
Extract structured data locally with gpt-oss 20B | YouRunAI