Most "run an LLM locally" guides assume you can install software. On a locked-down work laptop, you often cannot. A USB stick sidesteps that: the binaries, the models and the launcher all live on the drive, and nothing touches the host beyond RAM and CPU.
This is a setup that fits on a 4 GB stick: Ollama's standalone Windows build, llama3.2:1b, and a .bat file that starts the server and drops straight into a chat. No admin rights, no installer, no Python.
One caveat before the steps: the drive provides storage, not compute. The model loads into the host machine's RAM and runs on its CPU or GPU; the stick does not add memory.
The 4 GB budget
A "4 GB" drive is 4,000,000,000 bytes, or about 3.7 GiB before formatting. The Windows ZIP is 1.6 GB, but it expands to about 2.25 GB (2.1 GiB) as of Ollama v0.40.14. That leaves roughly 1.5 GiB for models and filesystem overhead — enough for one 1B model, not much else.
| Item | Approx. size | Fits with the app? |
|---|---|---|
| Ollama Windows archive (extracted) | 2.25 GB | — |
gemma3:1b | 0.8 GB | yes, ~0.9 GB spare |
qwen2.5:1.5b | 1.0 GB | yes, ~0.7 GB spare |
llama3.2:1b | 1.3 GB | yes, ~0.4 GB spare |
smollm2:1.7b | 1.8 GB | no |
llama3.2:3b | 2.0 GB | no |
phi3:mini | 2.2 GB | no |
Treat those numbers as approximate; the model library lists the exact size on each tag. Pick one model, not three.
The filesystem matters too. FAT32 caps a single file just under 4 GB, and many 4 GB sticks ship formatted that way. It works for these small models, but exFAT is the better default: no 4 GB file ceiling, and readable on Windows, macOS and Linux.
What you need
- Windows 10 1803+ or Windows 11, 64-bit
- 8 GB of RAM (16 GB is comfortable)
- A USB 3.0 stick; USB 2.0 works, but model load times suffer
- Internet access for the first model pull
1. Prepare the drive
Back up the stick, then format it as exFAT (right-click → Format). Label it something obvious, like OLLAMA.
2. Get the portable build
Download ollama-windows-amd64.zip from the official release page and extract it to a folder on the PC. The ZIP is 1.6 GB and the extracted folder is about 2.25 GB, so the PC needs room for both; a 4 GB stick cannot hold the archive and the extracted copy at once.
Copy only the extracted contents to the root of the stick. It should look like this:
E:\
├─ ollama.exe
├─ lib\
│ └─ ollama\
├─ models\ (created by the launcher)
└─ start-ollama.bat
The drive after setup
Windows Explorer showing ollama.exe, the lib folder, the models folder and start-ollama.bat in the root of the stick.
/blog/ollama-usb/drive-layout.png · 1600 px wideThe plain amd64 archive is the full, standalone build, and the safe choice for Intel/AMD CPUs and NVIDIA GPUs; it bundles CUDA libraries, which is why it is large. The -rocm asset is only a 257 MB overlay for AMD GPUs: its README says to extract it over the full archive, so it adds about 1 GB rather than replacing anything. On a 4 GB stick, skip the overlay.
If the release page publishes a checksum, compare it before running the binary:
Get-FileHash .\ollama-windows-amd64.zip -Algorithm SHA256
This matters more than usual: you are about to run an unsigned executable from a removable drive. Get it from the official release page, not a mirror.
3. Point the models at the stick
By default Ollama writes models to %USERPROFILE%\.ollama\models — the host disk. Set OLLAMA_MODELS to a folder on the stick before the server starts:
set "OLLAMA_MODELS=E:\models"
The folder is created on first use and ends up with blobs\ and manifests\. Everything the model needs is there; nothing is left on the host.
If you already have a model on the PC, copy %USERPROFILE%\.ollama\models to E:\models instead of downloading it again. Shut down any running Ollama server first; copying open blob files is a good way to corrupt them.
4. Pick a model that fits
One pull. Start with:
ollama pull llama3.2:1b
ollama run llama3.2:1b
llama3.2:1b is the best compromise on a 4 GB drive: about 1.3 GB on disk, roughly 2 GB of RAM, and fast enough to feel interactive on a modern laptop CPU. It leaves about 0.4 GB free, which is enough for the model and very little else. If you want more headroom, use gemma3:1b (about 0.8 GB) or qwen2.5:1.5b (about 1.0 GB).
Do not judge a 1B model against a hosted 70B model. It is useful for summarising, rewriting, naming things, extracting structured output and working offline. It is not going to replace your IDE's assistant.
The size in ollama list is the disk size, not the RAM requirement. A quantised model needs roughly its file size plus context and runtime overhead; assume 1.5–2× the file size in RAM.
5. Write the launcher
Create start-ollama.bat in the root of the stick and paste this:
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
set "OLLAMA_DIR=%~dp0"
set "OLLAMA_MODELS=%OLLAMA_DIR%models"
set "OLLAMA_HOST=127.0.0.1:11435"
set "MODEL=llama3.2:1b"
where curl.exe >nul 2>&1
if errorlevel 1 (
echo curl.exe is required. It ships with Windows 10 1803 and later.
pause
exit /b 1
)
set "PATH=%OLLAMA_DIR%;%PATH%"
if not exist "%OLLAMA_MODELS%" mkdir "%OLLAMA_MODELS%"
curl.exe -s -o NUL "http://%OLLAMA_HOST%/api/tags"
if errorlevel 1 (
echo Starting Ollama from "%OLLAMA_DIR%" ...
start "Ollama server" /min "%OLLAMA_DIR%ollama.exe" serve
)
set "TRIES=0"
:wait
curl.exe -s -o NUL "http://%OLLAMA_HOST%/api/tags"
if not errorlevel 1 goto ready
set /a TRIES+=1
if %TRIES% geq 30 goto failed
timeout /t 1 /nobreak >nul
goto wait
:failed
echo.
echo Ollama did not start within 30 seconds.
echo Run this in a terminal to see the error:
echo "%OLLAMA_DIR%ollama.exe" serve
pause
exit /b 1
:ready
echo.
echo Ollama is running on %OLLAMA_HOST%
echo Models: %OLLAMA_MODELS%
echo.
"%OLLAMA_DIR%ollama.exe" run %MODEL%
pause
endlocal
Why the details matter:
%~dp0is the folder containing the.bat, with a trailing backslash. It stays correct when the stick mounts asF:on another machine.cd /dmakes relative paths behave even if you launch the script from somewhere else.OLLAMA_HOST=127.0.0.1:11435binds the API to localhost and uses a non-default port, so it cannot collide with an Ollama install already running on the host. If 11435 is also taken, change it in both places.PATHis modified for this window only. Nosetx, no permanent environment changes.- The health check polls
/api/tagsinstead of sleeping for a fixed number of seconds. On a slow stick the server can take a while to open the port; on a fast one you get your prompt immediately. start ... /mingives the server its own minimised window. Close that window to stop the server; the chat window is only a client.
First run
The terminal after double-clicking start-ollama.bat: the server notice, the model prompt and a first answer.
/blog/ollama-usb/first-run.png · 1600 px wide6. Use it
Double-click start-ollama.bat. You should see the server start, the client connect, and a >>> prompt. Type a question, then /bye to leave.
The first run needs the network to pull the model. After that, everything is on the stick and the server does not need network access. The model is already cached.
To add a second model, run ollama pull <model> from a terminal that has OLLAMA_MODELS and OLLAMA_HOST set — the easiest option is a small pull-model.bat next to the launcher. Remember the 4 GB budget: with the app taking 2.25 GB, a second 1B model will not fit.
Models on the stick
ollama list output and the models folder in Explorer, showing blobs and manifests taking up most of the drive.
/blog/ollama-usb/models-folder.png · 1600 px wideTroubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
'ollama' is not recognized | The bundled folder is not on PATH | Use "%OLLAMA_DIR%ollama.exe" or run the .bat |
| Server exits immediately | Port in use, or missing lib\ollama | Change OLLAMA_HOST; re-extract the full archive |
connection refused | Server failed to start | Run ollama.exe serve in a terminal and read the error |
no space left on device | The model does not fit | Delete a model (ollama rm) or choose a smaller tag |
| Very slow first token | USB 2.0 or low RAM | Use USB 3.0; try a 1B model |
| SmartScreen warning | Unsigned binary | Confirm the SHA256 and the official release |
A note on security
Ollama's API has no authentication. Binding to 127.0.0.1 is what keeps it private; do not change it to 0.0.0.0 on a shared network. The models themselves are weights, not executable plugins, but treat anything you download as untrusted: pull from the official library, and keep the drive out of machines you do not control.
Assessment
For a locked-down laptop, the setup works. It is a folder, a model and a 40-line batch file. Local models are constrained by storage and memory, and a 1B model on a stick is a small offline assistant.
The same principle applies to the rest of the stack: the setup that survives is the one you can explain to the next person.
If you find a small model that performs well on this setup, I would like to hear about it.