Skip to content

Ollama Docs, Revised

OpenCode

Task page. 5 changes, 3 questions for the owner. Audit: improved. Original source at commit 318ee28.

Revised

OpenCode is an open-source coding agent that runs in your terminal, reads your project, edits files, and runs commands.

Ollama configures OpenCode to use local and cloud models.?1

Get started

Launch OpenCode with Ollama:

ollama launch opencode

Capabilities

1- Chat: Ask questions about a repository or task

  • Command line: Run commands from your working directory
  • File edits: Read and edit files in your project
  • Subagents: Split work across tasks
  • Web fetch: Fetch and summarize web pages
  • Vision: Send images and screenshots

Models

Choose a model with enough context for your repository.

Note: OpenCode requires a context length of 64k or higher.X11 See Context length for more information.

Manual setup

21. Install OpenCode

3On macOS or Linux:

curl -fsSL https://opencode.ai/install | bash

On Windows:

npm install -g opencode-ai

2. Configure Ollama as a provider

Add an Ollama provider to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "qwen3.5": {
          "name": "qwen3.5"
        }
      }
    }
  }
}

3. Run OpenCode

opencode

To configure OpenCode with Ollama without starting an interactive session:?2

ollama launch opencode --config

Configuration precedence

ollama launch opencode starts OpenCode with an inline config for the selected Ollama model. It doesn't overwrite ~/.config/opencode/opencode.json. Existing OpenCode settings still apply.4

Models defined only in opencode.json don't appear in the ollama launch model picker.5

See OpenCode's config precedence.

Notes on this page

  1. 1 Structure Audit: improved The page held raw JSX markup with empty icons; the six capabilities are now a bullet list with the same names and descriptions.

    Was: <div className="capability-list capability-list-full"> ... Chat / Ask questions about a repository or task ... Vision / Send images and screenshots ... </div>

    list-parallel-items-only

    Auditor: The bullet list presents the six capabilities more clearly than the raw markup.

  2. 2 Structure Audit: improved The three step titles were raw HTML paragraphs; they are now numbered headings with the same text.

    Was: <p className="manual-step-title">1. Install OpenCode</p> (and steps 2 and 3)

    proc-imperative

    Auditor: Numbered headings make the three setup steps easier to find and follow.

  3. 3 Structure Audit: improved The tab labels on the two code fences became a sentence before each block and plain language labels on the fences; the commands are unchanged.

    Was: shell macOS / Linux andpowershell Windows

    proc-substeps-branch-only

    Auditor: Plain language labels explain which installation command applies to each operating system.

  4. 4 Wording Audit: improved Use the contraction "doesn't" and split the sentence at the semicolon.

    Was: It does not overwrite ~/.config/opencode/opencode.json; existing OpenCode settings still apply.

    Contractions Semicolon

    Auditor: Splitting the semicolon sentence improves readability without changing its meaning.

  5. 5 Wording Audit: improved Use the contraction "don't".

    Was: Models defined only in opencode.json do not appear in the ollama launch model picker.

    Contractions

    Auditor: The contraction makes the sentence shorter without changing its meaning.

Questions for the owner

  • ?1 This page mixes a task (launch, manual setup) with reference (capabilities, precedence); should those parts stay on one page?

    About: “Ollama configures OpenCode to use local and cloud models.”

  • ?2 How should the reader confirm that OpenCode is using an Ollama model after setup?

    About: “To configure OpenCode with Ollama without starting an interactive session:”

  • X11 Recommended minimum context for agents, coding and web search. Context length and most coding integrations say 64k, while Web search says about 32000 and Cline and Roo Code say 32K for coding; the 64k note is also repeated on many integration pages. Is the recommended minimum 32k or 64k, and should integration pages link to one statement instead of repeating it?

    Pages: Context length, Web search, Use Cline with Ollama, Use Roo Code with Ollama, OpenCode, Run Codex CLI with Ollama, Run Droid with Ollama

Original

OpenCode is an open-source coding agent that runs in your terminal, reads your project, edits files, and runs commands.

Ollama configures OpenCode to use local and cloud models.

Get started

Launch OpenCode with Ollama:

ollama launch opencode

Capabilities

Chat Ask questions about a repository or task

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Command line</div>
    <div className="capability-list-copy">Run commands from your working directory</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">File edits</div>
    <div className="capability-list-copy">Read and edit files in your project</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Subagents</div>
    <div className="capability-list-copy">Split work across tasks</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Web fetch</div>
    <div className="capability-list-copy">Fetch and summarize web pages</div>
  </div>
</div>

<div className="capability-list-item">
  <div className="capability-list-icon"></div>
  <div>
    <div className="capability-list-heading">Vision</div>
    <div className="capability-list-copy">Send images and screenshots</div>
  </div>
</div>

Models

Choose a model with enough context for your repository.

Note: OpenCode requires a context length of 64k or higher. See Context length for more information.

Manual setup

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash
npm install -g opencode-ai

2. Configure Ollama as a provider

Add an Ollama provider to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "qwen3.5": {
          "name": "qwen3.5"
        }
      }
    }
  }
}

3. Run OpenCode

opencode

To configure OpenCode with Ollama without starting an interactive session:

ollama launch opencode --config

Configuration precedence

ollama launch opencode starts OpenCode with an inline config for the selected Ollama model. It does not overwrite ~/.config/opencode/opencode.json; existing OpenCode settings still apply.

Models defined only in opencode.json do not appear in the ollama launch model picker.

See OpenCode's config precedence.

What Changed

Raw interface markup became plain Markdown: the capability grid is now a bullet list, and the manual setup steps are numbered headings with labeled code blocks. Two contractions and a semicolon were fixed in the precedence section. Code blocks and links are unchanged; questions cover the page's mixed purpose, a missing confirmation, and the 64k context conflict.

Content type: task. The page's main job is to get a reader running OpenCode on Ollama, through ollama launch opencode or manual setup.

Automated check, original: 0 errors, 0 warnings, 3 suggestions. Revised: 0 errors, 0 warnings, 0 suggestions.

Independent audit (GPT-6): improved. The revision makes the capabilities easier to scan and the manual setup steps easier to follow. The listed wording changes preserve meaning, and I found no broken links or altered code blocks.

What the revision missed:

  • The revision leaves an unexplained ⟦X11⟧ marker in the context length note, but the notes list no matching question or change.
  • The revision notes say a question covers the 64k context conflict, but the questions list includes no such question; the page retains the context requirement without flagging the conflict for the documentation owner.

Structure (3)

  • 1 The page held raw JSX markup with empty icons; the six capabilities are now a bullet list with the same names and descriptions. improved
  • 2 The three step titles were raw HTML paragraphs; they are now numbered headings with the same text. improved
  • 3 The tab labels on the two code fences became a sentence before each block and plain language labels on the fences; the commands are unchanged. improved

Wording (2)

  • 4 Use the contraction "doesn't" and split the sentence at the semicolon. improved
  • 5 Use the contraction "don't". improved