ollama-qwen-setup
Skill1 starsChanged 2 months agoMITView on GitHub
Install Ollama and run Qwen3.8-27B locally, end to end - measure the machine's
- Pipes a download into a shell
- Installs packages
In this repository2 other files it gives its agents.
- resume-workSkill
- wrap-upSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
If a qwen3.8 model is already registered, say so and ask whether to reuse it, add another quant, or replace it.
- Very specific: line 95
Ask for an absolute folder.
- Very specific: line 98
If the system drive is short on space, set the blob store to the same drive before ollama create, and restart Ollama afterwards so it takes …
- Very specific: line 151
Write Modelfile next to the GGUF (absolute FROM path):
- Very specific: line 202
If it answers as if blind, mmproj-BF16.gguf is not registered - it must be in the same folder at ollama create time.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Install Ollama + Qwen3.8-27B locally
Take a machine with nothing installed to a working local qwen3.8-27b the user can call from
a terminal, an app, or the HTTP API. Nine steps. Do not skip the verification step - a model
that silently spills onto the CPU is the single most common bad outcome, and it looks like
success until the first prompt takes two minutes.
Every path you show the user is absolute. They will copy-paste it.
0. Facts this skill is built on
- Quants come from
unsloth/Qwen3.8-27B-GGUFon Hugging Face (Apache-2.0). TheUD-files are Unsloth Dynamic quants - mixed precision per tensor, better quality per GB than the plainQ4_0/Q8_0files at the same size. Prefer them. - Qwen3.8-27B is multimodal. Text works from the GGUF alone; images need
mmproj-BF16.gguf(~0.87 GB) alongside it. Always download both - it is small, and retrofitting it later means re-registering the model. ollama createcopies the GGUF into Ollama's blob store. Budget ~2.2x the model size in free disk, or move the store first (step 4).
1. Check what is already there
ollama --version # Windows fallback: & "$env:LOCALAPPDATA\Programs\Ollama\ollama.exe" --version
ollama listIf a qwen3.8 model is already registered, say so and ask whether to reuse it, add another
quant, or replace it. Do not silently re-download 17 GB.
2. Measure the hardware
NVIDIA (Windows or Linux):
nvidia-smi --query-gpu=name,memory.total,memory.used --format=csv,noheaderAMD: rocm-smi --showmeminfo vram. Apple Silicon: sysctl -n hw.memsize and
system_profiler SPHardwareDataType | grep Chip - unified memory, so usable budget is roughly
70% of total RAM.
Also read free disk on the drive the user will download to. If nothing reports a GPU, say plainly that this model will run on CPU at roughly 1-3 tokens/second and ask whether to continue or stop.
Report one line: GPU name, total VRAM, VRAM already in use, free disk.
3. Recommend a quant, then let the user choose
Compute the budget:
usable VRAM = total VRAM - VRAM already in use - 1.0 GB (display/OS)
weight budget = usable VRAM - 0.9 GB (mmproj) - 3.0 GB (KV cache at 32k context)Pick from reference/quants.md the largest quant whose size is at or under the weight budget,
and offer it plus the next size down as the safe option. Present two or three candidates
with their sizes and a one-line trade-off each, then ask which one - never decide alone.
Reference points, using the whole card:
| VRAM | Comfortable at 32k ctx | Tight but usually fits |
| 12 GB | UD-Q2_K_XL (9.2 GiB) | UD-IQ3_XXS (10.2 GiB) |
| 16 GB | UD-Q3_K_XL (12.2 GiB) | UD-IQ4_XS (13.3 GiB) |
| 24 GB | UD-Q4_K_XL (16.4 GiB) | UD-Q5_K_XL (19.4 GiB) |
| 32 GB | UD-Q5_K_XL (19.4 GiB) | UD-Q6_K_L (22.5 GiB) |
| 48 GB+ | UD-Q6_K_XL (23.6 GiB) | UD-Q8_K_XL (29.3 GiB) |
Sizes are from the Hub on 2026-09-03; the repo is re-quantized from time to time, so confirm the live size before quoting a download time:
curl -s "https://huggingface.co/api/models/unsloth/Qwen3.8-27B-GGUF?blobs=true" \
| python -c "import json,sys; [print(f\"{f['rfilename']:44s} {f.get('size',0)/2**30:6.2f} GiB\") for f in json.load(sys.stdin)['siblings'] if f['rfilename'].endswith('.gguf')]"Two things to say out loud when the tight option is chosen: it leaves no room for a second
model, and it forces num_ctx down. Below Q3 quality degrades noticeably on reasoning - a
smaller model at Q4 usually beats this one at Q2.
4. Ask where the models go
Ask for an absolute folder. Do not default it. Good answers are a data drive with room, e.g.
E:\AI_models_opensource\qwen3.8-27b or /home/<user>/models/qwen3.8-27b.
If the system drive is short on space, set the blob store to the same drive before
ollama create, and restart Ollama afterwards so it takes effect:
# Windows, persistent
[Environment]::SetEnvironmentVariable("OLLAMA_MODELS", "E:\ollama\models", "User")# Linux/macOS, persistent - add to the shell profile
export OLLAMA_MODELS=/mnt/data/ollama/models5. Install Ollama if missing
- Windows:
winget install --id Ollama.Ollama -e, or the installer from https://ollama.com/download. Installs toC:\Users\<user>\AppData\Local\Programs\Ollama\ollama.exeand adds itself to PATH - a new shell is needed beforeollamaresolves. - macOS:
brew install ollamathenbrew services start ollama, or the .dmg. - Linux:
curl -fsSL https://ollama.com/install.sh | sh(installs a systemd service). Show the user the command and let them run it; do not pipe a remote script to a shell on their behalf without saying what it does.
Confirm with ollama --version in a fresh shell before continuing.
6. Download the two files
Preferred - resumable, parallel, verifies checksums:
pip install -U "huggingface_hub[cli]"
hf download unsloth/Qwen3.8-27B-GGUF \
Qwen3.8-27B-UD-Q4_K_XL.gguf mmproj-BF16.gguf \
--local-dir "E:\AI_models_opensource\qwen3.8-27b"Substitute the chosen quant filename. No token is needed; the repo is public.
Fallback without Python:
curl -L -C - -o "E:\AI_models_opensource\qwen3.8-27b\Qwen3.8-27B-UD-Q4_K_XL.gguf" \
"https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/resolve/main/Qwen3.8-27B-UD-Q4_K_XL.gguf?download=true"This is a 17 GB download - tens of minutes on most connections. Run it in the background or in
a detached process, never in a call that will time out, and verify the byte size on disk
against the Hub before registering. A truncated GGUF fails at ollama create with a confusing
tensor error, and a proxy that returned an HTML error page leaves a 4 KB "model" behind.
7. Register the model
Write Modelfile next to the GGUF (absolute FROM path):
FROM E:\AI_models_opensource\qwen3.8-27b\Qwen3.8-27B-UD-Q4_K_XL.gguf
PARAMETER num_ctx 32768
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER min_p 0.0Those sampling values are Qwen's published recommendation for thinking mode - keep them unless
the user asks otherwise. num_ctx 32768 is the honest default: Ollama's built-in default is far
smaller, and a long document will be silently truncated without it. Raise it only if step 8
still reports 100% GPU.
ollama create qwen3.8-27b -f "E:\AI_models_opensource\qwen3.8-27b\Modelfile"This copies ~17 GB into the blob store and takes a few minutes. Running it twice with different
source files leaves both blobs on disk - ollama list will not show the orphan. Check the
store size afterwards if disk is tight.
8. Verify - this step is not optional
ollama run qwen3.8-27b "Reply with exactly: ok"
ollama psollama ps must show 100% GPU in the PROCESSOR column. Anything else (48%/52% CPU/GPU)
means the model does not fit and every prompt will be slow. Fix in this order:
- lower
num_ctx(32768 → 16384 → 8192), re-runollama create; - drop one quant level;
- close whatever else holds VRAM (a game, a browser with hardware acceleration, a running
render) and re-check
nvidia-smi.
Then time a real generation and report tokens/second, so the user has a baseline:
ollama run --verbose qwen3.8-27b "Explain a B-tree in 200 words."Vision smoke test, if the user has an image handy:
ollama run qwen3.8-27b "Describe this image. E:\path\to\image.png"If it answers as if blind, mmproj-BF16.gguf is not registered - it must be in the same folder
at ollama create time; re-run step 7 with both files present.
9. Hand back the card
Close with a short block the user can paste into their own notes. Nothing else - no recap of the steps.
Model qwen3.8-27b (Qwen3.8-27B UD-Q4_K_XL, vision enabled)
Files E:\AI_models_opensource\qwen3.8-27b\Qwen3.8-27B-UD-Q4_K_XL.gguf 16.4 GiB
E:\AI_models_opensource\qwen3.8-27b\mmproj-BF16.gguf 0.9 GiB
E:\AI_models_opensource\qwen3.8-27b\Modelfile
Context 32768 tokens GPU 100% ~42 tok/s on RTX 5090 Laptop 24 GB
Chat ollama run qwen3.8-27b
One-shot ollama run qwen3.8-27b "your prompt"
Image ollama run qwen3.8-27b "describe this. C:\path\img.png"
API curl http://localhost:11434/api/generate -d '{"model":"qwen3.8-27b","prompt":"hi","stream":false}'
Python pip install ollama
import ollama; ollama.chat(model="qwen3.8-27b", messages=[{"role":"user","content":"hi"}])
OpenAI SDK base_url="http://localhost:11434/v1", api_key="ollama"
Unload ollama stop qwen3.8-27b (frees VRAM; auto-unloads after 5 min idle)
Remove ollama rm qwen3.8-27b (deletes the blob copy, not the source GGUF)Fill in the real numbers you measured. Never write a tokens/second figure you did not time.
Known traps
ollamaon Windows opens the desktop app when run with no arguments.ollama <args>is the CLI. Not a failure.- Ollama must be running for any command to work. Windows/macOS: the tray app. Linux:
systemctl status ollama. A dead server givesconnection refusedon port 11434. num_ctxis per-model, baked in atollama create. Changing the Modelfile does nothing until you re-runollama create.- VRAM is shared with everything else on the card. A 24 GB card running a video render has
no room for this model. Check
nvidia-smiat the moment of the complaint, not from memory. - Do not delete the source GGUF to save space and then expect
ollamato break - it will not, the blob is a copy. But you also cannot re-register without re-downloading.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

