← All guides

Use Kimi or a local Ollama model in a coding agent

Two popular options for cheaper or private coding: Kimi (Moonshot) as a hosted model, and Ollama for running a model locally. Here's how each connects to a coding agent and what to watch for.

TL;DR: Both work if your agent lets you set the model endpoint. Kimi exposes an OpenAI-compatible API — set base URL, key, and model name. Ollama runs a model on your machine with a local OpenAI-compatible endpoint, so your code never leaves your computer and there's no per-token bill. The blocker is usually the agent, not the model: you need one that lets you bring your own model.

Kimi (Moonshot): a cheap hosted option

Kimi exposes an OpenAI-compatible endpoint, so wiring it into a coding agent is the usual three settings: base URL, API key, and model name. It's a hosted model (billed to you per token), which makes it a low-cost option for everyday coding work without running anything locally.

What to set for Kimi

FieldValueNotes
Base URLMoonshot's OpenAI-compatible endpointEnds in /v1 typically
API keyyour Moonshot keyBilled to you as usage
Model namethe Kimi model you wantWhatever the endpoint exposes

Ollama: run a model locally for $0/token

Ollama runs a model on your own machine and serves it over a local OpenAI-compatible endpoint. Point your agent's base URL at that local server and your code never leaves your computer — and there's no per-token cost at all. The tradeoff is hardware: bigger models need more RAM/VRAM, so you match the model to what your machine can run.

# Ollama serves an OpenAI-compatible endpoint locally
# e.g. http://localhost:11434/v1
# point your agent's base URL there, pick the model you pulled
Rule of thumb: hosted (Kimi) = cheap and easy, cloud-billed. Local (Ollama) = private and $0/token, but you supply the hardware.

The real requirement: an agent that lets you switch

Neither Kimi nor Ollama is the hard part — connecting them is. If your agent is locked to one provider, you can't point it at Kimi or a local endpoint at all. What you need is an agent where the provider, base URL, key, and model are settings you choose, so you can run Kimi today and a local model tomorrow without hacks.

What that looks like with Wuwei

Pick Kimi or local in the UI

OpenAI-compatible endpoints (Kimi) and local servers (Ollama) both work as a selectable provider.

One-click switch

Move between hosted and local models without editing configs or restarting.

Local + open source

The agent runs on your machine and is MIT-licensed; a local model keeps everything on-device.

FAQ

Can I use Kimi in a coding agent?

Yes — Kimi exposes an OpenAI-compatible endpoint, so you set the base URL, key, and model name in an agent that supports custom providers. It's a cheap hosted option for everyday coding.

Can a coding agent use a local Ollama model?

Yes. Ollama serves a model locally over an OpenAI-compatible endpoint; point the agent's base URL at it (e.g. http://localhost:11434/v1). Your code stays on your machine and there's no per-token cost.

Why can't my current agent use Kimi or Ollama?

Because it's hard-wired to one provider. You need an agent where provider/base URL/key/model are configurable. Wuwei lets you pick Kimi or a local model and switch in a click.

If you want to run your coding agent on Kimi for cheap hosted inference, or on a local Ollama model for private $0/token coding, you need an agent that lets you choose. Wuwei is a free, open-source agent where Kimi and local models are selectable providers — switch between them in a click.

Windows · macOS · Linux — free, no login