[PR #15922] launch/opencode: add image modalities for vision models #77654

Open
opened 2026-05-05 10:19:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15922
Author: @hoyyeva
Created: 5/1/2026
Status: 🔄 Open

Base: mainHead: hoyyeva/opencode-image-modality


📝 Commits (1)

  • b44ec49 launch/opencode: add image modalities for vision models

📊 Changes

2 files changed (+109 additions, -7 deletions)

View changed files

📝 cmd/launch/opencode.go (+38 -7)
📝 cmd/launch/opencode_test.go (+71 -0)

📄 Description

Summary

Teach the OpenCode launch integration to advertise image input for vision-capable Ollama models.
Previously, the inline OpenCode config only emitted basic model entries like:

"gemma4:26b": {}

This meant OpenCode had no capability metadata to indicate that a model could accept images, even when Ollama reported vision support.

This change updates the OpenCode config builder to:

  • probe model capabilities via Show()
  • add modalities.input = ["text", "image"] and modalities.output = ["text"] for vision-capable models
  • preserve the existing fallback behavior when capability probing is unavailable
  • keep the current behavior of not writing ~/.config/opencode/opencode.json

Example

A vision-capable model entry now looks like:

"gemma4:26b": {
  "name": "gemma4:26b",
  "modalities": {
    "input": ["text", "image"],
    "output": ["text"]
  }
}

Testing

  • added regression coverage for vision-capable OpenCode model entries
  • added fallback coverage when capability probing is unavailable
  • ran: env GOCACHE=/tmp/gocache go test ./cmd/launch -run 'TestOpenCode|TestBuildModelEntries' -count=1

Notes

This change intentionally only adds image support for models that report vision. It does not advertise pdf support.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15922 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 5/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `hoyyeva/opencode-image-modality` --- ### 📝 Commits (1) - [`b44ec49`](https://github.com/ollama/ollama/commit/b44ec49dd038e4455dcd0c2625e7cd83721cec59) launch/opencode: add image modalities for vision models ### 📊 Changes **2 files changed** (+109 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `cmd/launch/opencode.go` (+38 -7) 📝 `cmd/launch/opencode_test.go` (+71 -0) </details> ### 📄 Description ## Summary Teach the OpenCode launch integration to advertise image input for vision-capable Ollama models. Previously, the inline OpenCode config only emitted basic model entries like: ```json "gemma4:26b": {} ``` This meant OpenCode had no capability metadata to indicate that a model could accept images, even when Ollama reported vision support. This change updates the OpenCode config builder to: - probe model capabilities via Show() - add modalities.input = ["text", "image"] and modalities.output = ["text"] for vision-capable models - preserve the existing fallback behavior when capability probing is unavailable - keep the current behavior of not writing ~/.config/opencode/opencode.json ## Example A vision-capable model entry now looks like: ```json "gemma4:26b": { "name": "gemma4:26b", "modalities": { "input": ["text", "image"], "output": ["text"] } } ``` ## Testing - added regression coverage for vision-capable OpenCode model entries - added fallback coverage when capability probing is unavailable - ran: `env GOCACHE=/tmp/gocache go test ./cmd/launch -run 'TestOpenCode|TestBuildModelEntries' -count=1` ## Notes This change intentionally only adds image support for models that report vision. It does not advertise pdf support. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 10:19:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#77654