Running OpenCode Desktop application with local model & censorship #4139

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

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

Originally assigned to: @adamdotdevin on GitHub.

Question

Hi, im using LM studio to run an inference server for my local use.

I have created this config file in my %USERPROFILE%.config\opencode folder.

{ "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (Local)", "options": { "baseURL": "localhost:15432/v1" }, "models": { "mistralai/devstral-small-2-2512": { "name": "Mistral Devstral Small", "limit": { "context": 32280, "output": 8192 } } } } } }

But I got two problems.

  1. The model when used through opencode, it refuses to do any pen testing tasks (considered illegal by some, but im using my own model, so its overwriting the actual model default system prompt inside LM studio that removes the censorship)
Image
  1. The local model list displayed inside opencode is not actually any model that I have, however, if I do select any of them, the messages do come to my actual local model (mistral). So im not sure why the real model tag is not showing inside opencode. its just causing confusion, but not important.
Originally created by @Noorababi on GitHub (Jan 3, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Question Hi, im using LM studio to run an inference server for my local use. I have created this config file in my %USERPROFILE%\.config\opencode folder. `{ "$schema": "https://opencode.ai/config.json", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio (Local)", "options": { "baseURL": "localhost:15432/v1" }, "models": { "mistralai/devstral-small-2-2512": { "name": "Mistral Devstral Small", "limit": { "context": 32280, "output": 8192 } } } } } }` But I got two problems. 1. The model when used through opencode, it refuses to do any pen testing tasks (considered illegal by some, but im using my own model, so its overwriting the actual model default system prompt inside LM studio that removes the censorship) <img width="966" height="852" alt="Image" src="https://github.com/user-attachments/assets/990fe1d7-b3a7-461f-bd86-4a261883dc80" /> 2. The local model list displayed inside opencode is not actually any model that I have, however, if I do select any of them, the messages do come to my actual local model (mistral). So im not sure why the real model tag is not showing inside opencode. its just causing confusion, but not important.
yindo added the windowsweb labels 2026-02-16 17:42:45 -05:00
yindo closed this issue 2026-02-16 17:42:45 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6231: Auto-discover models from OpenAI-compatible provider endpoints - addresses the model list display issue where unconfigured models appear
  • #4232: OpenCode displays models which aren't configured & don't exist in LM Studio - same root cause as your second problem
  • #2456: LM Studio Models are not listed correctly - related to incorrect model display in LM Studio

These issues specifically address the second problem you mentioned (incorrect model list display). For your first issue regarding content censorship/pen testing refusal, this appears to be related to system prompt handling. You may want to check issue #5005 (unexpected system prompt parts despite disabling default agents) for related system prompt injection concerns.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 3, 2026): This issue might be a duplicate of existing issues. Please check: - #6231: Auto-discover models from OpenAI-compatible provider endpoints - addresses the model list display issue where unconfigured models appear - #4232: OpenCode displays models which aren't configured & don't exist in LM Studio - same root cause as your second problem - #2456: LM Studio Models are not listed correctly - related to incorrect model display in LM Studio These issues specifically address the second problem you mentioned (incorrect model list display). For your first issue regarding content censorship/pen testing refusal, this appears to be related to system prompt handling. You may want to check issue #5005 (unexpected system prompt parts despite disabling default agents) for related system prompt injection concerns. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4139