Osaurus integration leads to Exceeded model context window size #4135

Open
opened 2026-02-16 17:42:45 -05:00 by yindo · 1 comment
Owner

Originally created by @Oneiros90 on GitHub (Jan 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I'm trying to use Osaurus as a model provider in a macOS environment, since I want to use Apple's Foundation local model. This is my configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "osaurus": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Osaurus",
      "options": {
        "baseURL": "http://127.0.0.1:1337"
      },
      "models": {
        "foundation": {
          "name": "Apple Foundation Model",
          "limit": {
            "context": 200000,
            "output": 65536
          }
        }
      }
    }
  }
}

And this is the error I get when I try to push any prompt:
Exceeded model context window size

I am working in VSCode but I also tried in the terminal through opencode run --model osaurus/foundation "hello"

Plugins

None

OpenCode version

1.0.220

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

No response

Originally created by @Oneiros90 on GitHub (Jan 3, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I'm trying to use Osaurus as a model provider in a macOS environment, since I want to use Apple's Foundation local model. This is my configuration: ``` { "$schema": "https://opencode.ai/config.json", "provider": { "osaurus": { "npm": "@ai-sdk/openai-compatible", "name": "Osaurus", "options": { "baseURL": "http://127.0.0.1:1337" }, "models": { "foundation": { "name": "Apple Foundation Model", "limit": { "context": 200000, "output": 65536 } } } } } } ``` And this is the error I get when I try to push any prompt: `Exceeded model context window size` I am working in VSCode but I also tried in the terminal through `opencode run --model osaurus/foundation "hello"` ### Plugins None ### OpenCode version 1.0.220 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System macOS 26.2 ### Terminal _No response_
yindo added the bug label 2026-02-16 17:42:45 -05:00
Author
Owner

@rekram1-node commented on GitHub (Jan 3, 2026):

whats the actual context size of the model? i havent looked but i woudl think its smaller than 200k

@rekram1-node commented on GitHub (Jan 3, 2026): whats the actual context size of the model? i havent looked but i woudl think its smaller than 200k
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4135