ollama
Ollama: Déploiement IA Local
Exécutez n'importe quel modèle d'IA localement avec Ollama. Guide complet pour configurer Ollama avec AI Gateway comme solution de secours.
1 octobre 2026ollamalocalauto-hebergementhors ligne
Ollama: Local AI Deployment
Ollama lets you run AI models locally on your machine — zero API costs, complete data privacy, offline operation. Pair Ollama with AI Gateway as a fallback layer: local models as primary, cloud as automatic fallback. Best of both worlds.
Models You Can Run Locally
| Family | Popular Models | Active Params | Hardware |
|---|---|---|---|
| DeepSeek | V4-Pro, V4-Flash, R1 | 13B–49B | RTX 4090 or better |
| Llama | 4, 3.3, 3.2 | 7B–70B | 8GB–48GB VRAM |
| Qwen | 3.8, 3.5, 3 | 0.6B–235B | 4GB+ VRAM |
| Mistral | Small 3, Nemo, 7B | 7B–22B | 8GB+ VRAM |
| Gemma | 4, 3, 2 | 2B–27B | 6GB+ VRAM |
Quick Start
Install
bash
# macOS / Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows: Download from https://ollama.com/download
ollama --version
Pull & Run
bash
# Pull models
ollama pull deepseek-v4-flash
ollama pull llama-3.3-70b
ollama pull qwen-3.5-flash
# Run interactively
ollama run deepseek-v4-flash
# Run with custom context
ollama run deepseek-v4-pro --num_ctx 131072
Python Integration
python
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1",
api_key="ollama" # Required but unused
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Explain Docker in simple terms."}]
)
Key Capabilities
Zero API Costs
After hardware purchase, running models costs nothing per query
- No per-token charges
- No rate limits
- Unlimited usage
- One-time hardware investment
Complete Data Privacy
All data stays on your machine — HIPAA, GDPR compliant by design
- No data leaves your infrastructure
- Full audit trail locally
- Enterprise security requirements met
- Healthcare and legal use cases
Offline + AI Gateway Fallback
Seamless hybrid: local models primary, cloud as automatic fallback
- AI Gateway detects Ollama availability
- Automatic failover when offline
- No user-facing errors
- Privacy + reliability combined
Hybrid Setup
python
import socket
def is_ollama_running():
try:
sock = socket.socket()
sock.settimeout(1)
sock.connect(("localhost", 11434))
sock.close()
return True
except:
return False
def get_client():
if is_ollama_running():
return OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
else:
return OpenAI(api_key="your-ai-gateway-key", base_url="https://api.ecaix.com/v1")
# Seamlessly switches between local and cloud
client = get_client()
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Hello."}]
)
Hardware Guide
| Model Size | Min RAM | Recommended | GPU |
|---|---|---|---|
| 7B | 8 GB | 16 GB | Optional |
| 13B | 16 GB | 24 GB | Recommended |
| 33B | 32 GB | 48 GB | Strong |
| 70B | 64 GB | 128 GB | Required |
| 405B | 256 GB | 512 GB | Multi-GPU |
Related Models (Self-Host via Ollama)
- DeepSeek V4 — Best Ollama candidate (open weights, low compute)
- Meta Llama — Largest ecosystem via Ollama
- Qwen — Best multilingual via Ollama
- Mistral — Fast small models for Ollama
- View all models →
Ready to build with Ollama?
One API Key, every model. Transparent pay-as-you-go pricing with credits that never expire.
Create free account