Module 9: Installing your first local AI · Lesson 9.6 · about 20 min
Pull the cable: testing it fully offline
A ten-minute test that proves your setup needs no internet, and how to fix the pieces that quietly still reach out.
Module 9 · about 20 minutes · read first: 9.1 to 9.5. You’ll be able to prove your setup works with no connection and fix the parts that do not.
1. Why this matters
“It should work offline” is not the same as “it works offline”. If you rely on local AI on a plane, at a site with no signal or in a secure room, find the gaps at your desk, not there.
2. The ten-minute test
- Prepare online: open each tool you will use and run each model once.
- Cut the connection: switch off Wi-Fi and unplug any network cable. Turn on flight mode (all wireless off) on a laptop.
- Restart the apps (some only notice on start-up).
- Use every part: chat, load each model, run your scripts, upload a document.
- Write down anything that hangs, shows an error or says “connecting”.
- Reconnect, fix each item (below), and test again.
3. Why one gap breaks everything
Your setup is a chain: app, models, scripts, document search. If any link needs the internet, the job fails. Small doubts multiply.
Watch it happen: five links, each “probably fine”
One part. The chat app is 90% likely to work offline untested. The chance the job works: 90%.
Two parts. Add a model, also 90%. Both must work: 0.9 × 0.9 = 81%.
Five parts. App, model, script, documents, search tool, each 90%: 0.9 × 0.9 × 0.9 × 0.9 × 0.9 = 0.9⁵ ≈ 59%. Little better than a coin toss.
After the test. You pull the cable, use every part, fix the two that failed and test again. Now each link is checked, not guessed: the job works.
Maths and principle
Principle: a chain works offline only if every link does.
Equation: chance the whole setup works = product of the chance each part works offline.
Analogy: Christmas lights wired in a line: one dead bulb and the whole string is dark. Testing each bulb is quicker than guessing.
Try it: five parts, each 90% likely to be fine untested? (0.9⁵ ≈ 0.59: only a 59% chance the untested setup works. Testing turns guesses into certainties.)
- p1 … pn
- the chance that each part works with no connection (an app, a model, a script)
- n
- how many parts the job needs
- Pall
- the chance the whole job works: all the chances multiplied
- Physical meaning
- Every part you add is another bulb in the string. Even parts that are "almost certainly fine" add up to real risk, which is why a ten-minute test before a trip is worth more than any amount of reading settings pages.
4. Common gaps and fixes
| Symptom offline | Likely cause | Fix |
|---|---|---|
| Python script stalls at “loading model” | The library checks Hugging Face for updates | Download once, then set HF_HUB_OFFLINE=1 |
| App shows “checking for updates” | Update check on start | Turn off automatic updates in its settings |
| Document upload fails | The embedding model (Module 12) was never downloaded | Upload one document while online first |
| A tool says “web search failed” | A search plug-in is switched on | Turn the tool off for offline use |
| Model missing | Only one size was downloaded | ollama list before you leave |
Setting the variable: on Windows PowerShell $env:HF_HUB_OFFLINE="1"; on Mac or Linux export HF_HUB_OFFLINE=1. Lesson 11.2 shows how to set it inside a script.
“I’ll just ask the model whether it is working offline.” The model has no idea whether your computer is connected; it only predicts text. It may happily say “yes, I’m offline” while a script in the background waits for a website. Only pulling the cable tells you.
5. Worked example
Made-up numbers. Jo is flying 14 hours and wants to draft a report. She runs the test the night before. Chat works; her summarising script stalls. The cause is a Hugging Face check at start-up. She adds HF_HUB_OFFLINE=1, tests again with the cable out, and it runs. On the plane everything works.
6. Practice
- Run the ten-minute test on your own setup.
- Which parts of your setup are “online once” and which “offline always”? (Use the diagram in 1.3.)
- Your chat window works offline but its document upload does not. What is the most likely cause?
Answers
- Keep the list of fixes: it is your setup’s offline checklist.
- Online once: app install, model downloads, embedding model. Offline always: chats, scripts, documents already indexed.
- The embedding model it uses for documents was never downloaded. Upload one document while online.
New words: flight mode (all wireless off), cache (files kept locally so they need not be fetched again), embedding model (a small model that turns text into numbers for search, Module 12).
- “Should work offline” is a guess; cutting the connection and using every part is the proof.
- Prepare online first: open each tool and run each model once so all files are cached.
- The chance a setup works is the product of each part’s chance: five parts at 90% give only 59%.
- Common fixes: HF_HUB_OFFLINE=1, update checks off, embedding model downloaded, web tools off.
Check yourself
Sources
- Hugging Face offline mode (HF_HUB_OFFLINE), https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables
- Hugging Face Transformers installation guide: offline mode (official page), https://huggingface.co/docs/transformers/installation
- Ollama FAQ: settings, proxies and where models are kept (official page), https://docs.ollama.com/faq
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. Prices and model names change fast: check the official source before you buy.