---
title: "Local models"
description: "Run Kai Code turns on your own hardware with Ollama or any OpenAI-compatible endpoint."
url: https://docs.gleap.ai/en/articles/698-local-models
collection: "Kai Code"
updated: 2026-11-01
language: en
---

# Local models

Run Kai Code turns on your own hardware with Ollama or any OpenAI-compatible endpoint.

Besides the hosted models and your own coding-agent subscriptions through [Kai Code Bridge](https://gleap-developer-docs.gleap.help/en/articles/697-kai-code-bridge), Kai Code can run on models you host yourself. Local models are configured under **AI agents → Kai Code → Settings → Local LLM** and appear in the composer's model picker with a **Local** label. Turns on a local model run on your machine and are **not billed by Gleap**.

> **Note:** Local models are available in the **Gleap Desktop** app only, and need the _Kai Code local_ permission. In the browser the tab explains where to get the app.

## Ollama

Models from a local [Ollama](https://ollama.com) install (default `http://127.0.0.1:11434`). Pull a model on the machine and open the tab. Kai detects installed models automatically, or use **Detect**. Added models become selectable in Kai Code's local runtime.

Pick a model that **supports tool calls** and fits your memory. Coding sessions rely heavily on tools (reading files, running commands), so a model without tool support cannot complete a task.

## Custom OpenAI-compatible endpoints

Any server that speaks the OpenAI chat-completions API: llama.cpp, LM Studio, vLLM, or a box on your LAN. Choose **Add endpoint** and enter:

-   **Label**: the slug shown in the model picker. Models appear as `<label>/<model>`.
    
-   **Base URL**: the OpenAI-compatible root of the server, including `/v1`.
    
-   **API key**: optional; leave empty for local servers.
    
-   **Model id** and **Context window** for each model the endpoint serves.

## Related

- [Kai Code](https://docs.gleap.ai/en/articles/688-kai-code.md)
- [Getting started](https://docs.gleap.ai/en/articles/689-getting-started.md)
- [Sessions](https://docs.gleap.ai/en/articles/690-sessions.md)
- [Tickets and pull requests](https://docs.gleap.ai/en/articles/691-tickets-and-pull-requests.md)
- [Your own coding agent](https://docs.gleap.ai/en/articles/692-your-own-coding-agent.md)
