In this categoryLocal AI · 70
- Speridlabs Idol: Turn One Photo into a 3D Gaussian Splat, and How to Run It
- LFM3-Omni-2B: Liquid AI's 2.2B Any-to-Any Model, and How to Run It Locally
- SenseNova-Loop-9B-Preview: A Looped Multimodal Model for Long-Context Work, and How to Run It
- How to Run WeVisOne-VL-4B Locally: Tencent's All-in-One Vision Model
- How to Run Mistral Large 4 (1T-A52B) Locally: The Hardware It Actually Needs
- How to Run Hy-SimulMT-30B-A3B-FP8 Locally: Tencent's Real-Time Speech Translator
- How to Run Chroma1-HD Locally: An Open Base Model for Text-to-Image
- How to Run Nemotron 3.5 Parse Locally: NVIDIA's 630M Document Parsing Model
- How to Run Recursive Flint Locally: a 39.8B Coding Model You Can Actually Fit on a Mac
- How to Run Phonon-40M-en Locally: Gradium's 40M-Parameter Text-to-Speech Model
- How to Run Timestral-209M Locally: Mistral's 209M-Parameter Time Series Forecasting Model
- How to Run Indra OCR Locally: a 1M-Parameter CPU Model That Hits 49 Pages a Second
- How to Run AuroraIMG-6M Locally: AuroraAI-Research's 6.82M-Parameter Text-to-Image Model
- How to Run Maya-1 Locally: a 3.3B-Parameter Text-to-Speech Model with Voice Design
- How to Run Sopro V2 Turbo Locally: a 120M-Parameter Voice Cloning TTS Model
- How to Run Kova TTS 1 Locally: a 1.25B-Parameter Voice Cloning Model for Narration
- How to Run Whistle Locally: Cactus's 16.9MB On-Device Speech Recognition Model
- How to Run Antalia-2 Mini Locally: a 7.6M-Parameter Turkish TTS Model
- How to Run Supra2-IMG Locally: SupraLabs' 104M-Parameter Text-to-Image Model
- How to Run VisionHOPE Locally: PSRben's Self-Modifying Vision Backbone
- Fish Audio S1-Mini: What It Is and How to Actually Try It
- How to Run SupraTTS-0.1-Beta Locally: A Tiny Glow-TTS Voice Model
- How to Run Nemotron 3 Diarization Locally: Streaming Speaker Tagging in 99M Parameters
- How to Run Freya-TTS Locally: A 183M-Parameter Turkish Text-to-Speech Model
- How to Run Audio8 ASR Infinite Locally: Streaming Speech Recognition That Never Stops
- How to Run TeleOCR Locally: One Model for Scanned and Photographed Documents
- How to Run Xing4.0-29B-A4B Locally: A 256K-Context MoE Model for Agent Tasks
- How to Run IndicF5 Locally: Voice Cloning for 11 Indian Languages
- How to Run Fish Audio S2 Pro Locally: Multilingual TTS with Inline Emotion Control
- How to Run ZDTaichu5.0-9B Locally: A 9.79B Vision-Language Model Built for Spatial Reasoning
- How to Run Qwen3-TTS-12Hz-1.7B-VoiceDesign Locally: Voice Design From a Text Description
- How to Run YuE2-3B Locally: Open Source Music Generation That Beats Suno v5 on Benchmarks
- MiniCPM5-2B: Install and Run OpenBMB's 2B Model That Outscores 4B Rivals
- BERT Base Uncased: Specs, How to Run It, and Why It's Still Trending in 2026
- How to Run tencent/AuK Locally: Zero-Shot TTS, Voice Cloning and Speech Editing
- Stable Diffusion 3.5 Medium: What's Different From SDXL and Flux
- Qwen-Image-2512: The Text-to-Image Model That Renders Real Text
- How to Run Irodori-TTS Anime Locally: Japanese Voice Cloning and Voice Design
- How to Run Breeze TTS 2 Locally: Voice Clone, Voice Design and Voice Direction
- How to Run Kokoro-82M Locally: the Fastest Open-Weight TTS Model
- How to Install Ollama on macOSStart
- How to Install Ollama on Windows
- How to Run Llama 3 Locally with Ollama
- How to Pick the Right Local AI Model for Your Hardware
- Best GGUF Models to Run by VRAM Tier (8GB, 12GB, 16GB, 24GB, 48GB)
- Run LLMs in Your Browser With WebGPU: No Install, No Server (WebLLM)
- How to Use Ollama as a Drop-In OpenAI API
- GGUF vs MLX vs NVFP4: Local AI Quantization Formats Explained
- Best GPU for Running AI Locally in 2026Start
- How Much RAM Do You Need for Local AI?
- Mac vs PC for Local AI: Which Should You Choose?
- How to Build a Local AI Workstation on Any Budget
- How to Set Up Local AI on 8GB of VRAM
- How to Set Up Local AI on 12GB of VRAM
- Best Local LLM for 16 GB VRAM: Setup, Quantization and Real Speed
- How to Set Up Local AI on 24GB of VRAM
- Best Local LLM on Mac M4 16 GB: Setup, MLX vs GGUF and Real Speed
- Best Local LLM on Mac M4 Pro 48GB: Setup, Quantization and Real Speed
How to Use Ollama as a Drop-In OpenAI API
Point any OpenAI-compatible SDK or tool at your local Ollama server by changing one URL, and use OLLAMA_HOST to expose it on your network.
Ollama ships a REST API that mirrors the OpenAI chat completions spec. Any library or tool that accepts a custom base URL, including the official OpenAI Python and Node SDKs, LangChain, LlamaIndex, and Continue, can talk to your local Ollama server with zero code changes beyond the base URL and a dummy API key. This guide covers the raw curl calls, the Python SDK, and the environment variables that control how Ollama exposes itself.
What you need
- Ollama installed and running (ollama serve or the background service)
- At least one model already pulled (ollama pull llama3.3)
- curl for the verification steps
- Python 3.9+ or Node 18+ if you want to follow the SDK examples
Step 1: Understand the endpoint layout
Ollama exposes two API families on port 11434. The native Ollama API under /api is richer but non-standard. The OpenAI-compatible API under /v1 is the one you use for drop-in replacement.
- GET http://localhost:11434 — health check, returns 'Ollama is running'
- GET http://localhost:11434/v1/models — list available models in OpenAI format
- POST http://localhost:11434/v1/chat/completions — chat completions (same body as OpenAI)
- POST http://localhost:11434/v1/completions — legacy text completions
- POST http://localhost:11434/v1/embeddings — embeddings (requires an embedding model like nomic-embed-text)
Step 2: Test with raw curl
Before touching any SDK, confirm the endpoint works with curl. The body is identical to what you would send to api.openai.com, but with a local URL and any non-empty string as the API key.
Step 3: Use the OpenAI Python SDK
Install the official openai package and point it at your local server. Change only base_url and api_key. The rest of your code stays identical to what you wrote for the real OpenAI API.
- from openai import OpenAI
- client = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')
- response = client.chat.completions.create(
- model='llama3.3',
- messages=[{'role': 'user', 'content': 'What is the capital of France?'}]
- )
- print(response.choices[0].message.content)
Step 4: Use the OpenAI Node.js SDK
- import OpenAI from 'openai';
- const client = new OpenAI({ baseURL: 'http://localhost:11434/v1', apiKey: 'ollama' });
- const res = await client.chat.completions.create({
- model: 'llama3.3',
- messages: [{ role: 'user', content: 'What is the speed of light?' }],
- });
- console.log(res.choices[0].message.content);
Step 5: Expose Ollama on your local network
By default Ollama listens only on 127.0.0.1, so only the local machine can reach it. Set the OLLAMA_HOST environment variable to bind to all interfaces and reach it from other devices on the same network, such as a phone or another dev machine.
Streaming responses
Ollama supports streaming the same way OpenAI does. Set stream: true in the request body and iterate over the server-sent events. Both the Python and Node SDKs abstract this into async iterators.
At this point any tool or library built for the OpenAI API works against your local Ollama server. Switch model names to llama3.3, codellama, mistral, or any other pulled model. You can also run multiple models and switch between them per request, which the local server handles by loading and unloading from GPU memory automatically.
Local models run better with more VRAM. CompareRTX GPUs on Amazonbefore you upgrade.(affiliate link. We may earn a commission at no extra cost. Disclosure)
Watch related tutorials
5:30
14:20
10:05
9:42
8:55
10:30Weekly local AI drops
New models, what runs on your hardware, and the guides to set them up. One email a week, unsubscribe any time.