← What's possible

Miles with a local model

Use Miles with a model you run yourself

You can use Miles from any model, including one you run yourself on a Mac, a Windows PC, a Linux box or your own server. Ask which card to use, which credits are left this month, or where to transfer your points. Your conversation stays on your hardware, and Miles answers with your real wallet.

About fifteen minutes, most of it the model download.

A model on your own computer, run through OpenCode and connected to Miles, answering a wallet question
Local model · OpenCode · Miles· Example
Setup
Example: Qwen3.5 27B in Ollama, OpenCode as the harness, Miles added as a remote MCP server. The question and the answer stay on your computer.
PartWhere it runs
ModelQwen3.5 27Byour computer
HarnessOpenCodeyour computer
Milestool callsmcp.askmiles.ai
Answeryour cards · groceries · the best one

The model and the harness run on your computer. Only the tool calls reach Miles.

How it fits together

A local setup has three parts, and you can pick each one:

  • A model runtime serves the model on your hardware: Ollama, LM Studio, llama.cpp, vLLM or anything with an OpenAI-compatible API.
  • An MCP client holds the conversation and calls tools: a terminal harness such as OpenCode or pi, a chat app such as Open WebUI, LM Studio or Goose, or an agent you build.
  • Miles is the remote MCP server at https://mcp.askmiles.ai/mcp. The client signs in with OAuth, the same sign-in Claude and ChatGPT use.

Choose a model trained for tool calling and give it a context of at least 64,000 tokens. Miles offers a few dozen tools, and their definitions take about 24,600 tokens, so the larger context leaves room for your question and the answer. This guide uses Qwen3.5 27B, one of the most popular open models for tool use. Smaller models have not been tested thoroughly.

The steps below set this up with Ollama and OpenCode or pi, which run on macOS, Windows and Linux. Any other combination connects to Miles the same way.

Before you start

  1. Hardware that holds the model. Qwen3.5 27B is a 17.5 GB download: a Mac with 32 GB of memory, or a PC or server with a 24 GB graphics card, runs it.
  2. A Miles account with your cards entered. The model answers from what is in your wallet.
  3. Your data and your AI, read once. It lists what a connected app sends Miles, and it applies to a local model the same way it applies to Claude.

Step 1: Run a model

Ollama serves the model on your machine. Pull it and start the server with a 64,000 token context:

ollama pull qwen3.5:27b OLLAMA_CONTEXT_LENGTH=64000 ollama serve

On Windows, set OLLAMA_CONTEXT_LENGTH as an environment variable before you start Ollama. In LM Studio, llama.cpp or vLLM, load the same model with a 64,000 token context.

Step 2: Pick a harness

A harness is the program that holds the conversation, sends it to the model, and calls tools for it. OpenCode and pi both run in a terminal and speak MCP. Ollama starts either one on your local model:

ollama launch opencode --model qwen3.5:27b ollama launch pi --model qwen3.5:27b

Use whichever you prefer. Quit it for now; you add Miles in Step 3.

Step 3: Add Miles

Add the server and sign in.

OpenCode adds the server to the project in your current folder. Add --global to have Miles in every project:

opencode mcp add miles --url https://mcp.askmiles.ai/mcp opencode mcp auth miles

pi:

pi mcp add miles --url https://mcp.askmiles.ai/mcp pi mcp login miles

Any other client: add https://mcp.askmiles.ai/mcp as a remote MCP server (Streamable HTTP, OAuth) and sign in when it asks.

Sign-in opens in a browser, or the client prints the link. Miles shows a consent screen that lists what the app will be able to do and what it can never do ("Apply for cards, make payments, or see your email, phone, or chat history"). Two toggles grant changes to your wallet, and both start off:

  • Also record credit, certificate and balance usage. The app can mark a credit used, a certificate redeemed, a balance updated.
  • Also allow changes to your wallet. The app can add, change and remove cards, valuations and more.

With both off, the app can read your wallet and change nothing. When the client runs on a different computer than your browser, such as a server you reach over ssh, OpenCode asks you to paste the callback address from the browser. Settings, Connected AI Apps, lists the app afterwards with what it may do, and a Disconnect button.

Step 4: Ask

Start the harness again and ask what you would ask Miles:

Which of my cards should I use for groceries this week, and why?

The model calls Miles for your cards and the best one for the category, then answers in your terminal. Try the rest of what Miles knows:

  • Which of my credits expire this month?
  • Where should I transfer my points for a business class flight to Tokyo?
  • Is my annual fee worth keeping this year?

Record something in your wallet

With a write toggle on, the model can keep your wallet up to date. Tell it you used a credit and it records the credit as used. Miles marks every write from a connected app, and your credits page shows it as "Recorded by a connected app" under the status. The model can clear what it recorded; records you entered yourself stay as they are, and you change those on iOS or at /card-credits.

What reaches Miles

Your conversation and your files stay on your hardware. Your wallet lives with Miles, encrypted with a key that belongs to your account; the security page covers how. Each tool call carries the detail the answer needs, such as a category, a merchant or an amount, so leave out of the question anything you would keep from Miles.

Connect your AI has the other connectors, and OpenClaw runs an agent of your own with a model you choose. If a client refuses the connection, say which.

Hand this guide to your AI

This page is also available as plain markdown. Give the address to your AI and ask it to follow the guide:

https://askmiles.ai/workflows/miles-with-a-local-model.md

Related

  • Connect your AI
  • Miles for OpenClaw
  • Which card to use

Written on 2026-11-10 from runs against the hosted server at mcp.askmiles.ai with Ollama 0.40.11, OpenCode 2.2.6 and pi 1.4.0.