On this page

Local AI models

Run chat and embeddings on your own machine with Ollama, and switch providers without changing the app.

The platform ships with local models by default. Nothing you type, upload, or ask leaves the machine unless you configure a cloud provider.

Default models

PurposeModelNotes
Chatqwen2.5:7bGood instruction following, runs on a laptop GPU or Apple silicon
Embeddingsnomic-embed-text768 dimensions, matches the database schema
ollama pull qwen2.5:7b
ollama pull nomic-embed-text

Choosing a provider

SettingBehaviour
AI_PROVIDER=ollamaLocal models only; works offline
AI_PROVIDER=geminiCloud models; needs an API key
AI_PROVIDER=stubDeterministic fakes for tests, no model needed
AI_PROVIDER=autoGemini when a key is present, otherwise Ollama

The embedding provider follows the same rule. Chat and embeddings must agree on dimensions, which is why both default to 768.

Privacy

With ollama:

  • Prompts and documents stay local.
  • The only network traffic is between the web app, the service, and Ollama on the same machine.
  • Model downloads happen once, when you pull them.

With gemini, the passages sent in the prompt leave the machine. Uploaded files themselves stay in your database.

Performance

WorkloadTypical local result
Grounded answerp50 ~2.4 s, p95 ~6.2 s
Ungrounded chatslower; the model tends to keep writing
Ingestion1–2 s per 16-page PDF

A 7B model is the sweet spot for a laptop. Larger models improve phrasing but cost latency, and a small model plus good retrieval usually beats a large model with poor retrieval.

Changing models

  1. Pull the model with Ollama.
  2. Set OLLAMA_MODEL (and OLLAMA_EMBED_MODEL) in the environment.
  3. Restart the service.
  4. Re-run the evaluation to confirm quality did not drop.

Changing the embedding model invalidates existing vectors: re-ingest documents after switching, because old and new vectors are not comparable.

Guide feedback

Did this guide get you unstuck?

Tell us whether this guide answered your question.

MFU AI Knowledge Studio · practical guidance for learning, teaching, and platform operations