Compare commits
6 Commits
feature/we
...
feature/op
| Author | SHA1 | Date | |
|---|---|---|---|
| 218dc1d0d1 | |||
| 9246decc9f | |||
| 1ce6cea6c9 | |||
| 5b7c1f98bd | |||
| 5bd2eb398e | |||
| 3e373104e7 |
30
README.md
30
README.md
@@ -22,10 +22,9 @@ A first run from a clean checkout.
|
||||
|
||||
```yaml
|
||||
services:
|
||||
weave-proxy:
|
||||
opencode:
|
||||
environment:
|
||||
WEAVE_API_KEY: "your-key-here"
|
||||
opencode:
|
||||
volumes:
|
||||
- /path/to/your/repo:/workspace/repo
|
||||
```
|
||||
@@ -55,7 +54,7 @@ changes the current session; to change the default for every session, edit
|
||||
|
||||
### Change the default model
|
||||
|
||||
Edit `model` (and optionally `small_model`) in
|
||||
Edit `model` (and optionally `agents.title.model`) in
|
||||
[`config/opencode/opencode.json`](config/opencode/opencode.json), then apply the
|
||||
change:
|
||||
|
||||
@@ -68,13 +67,17 @@ needed.
|
||||
|
||||
### Register a new weave model
|
||||
|
||||
Add the model under `provider.weave.models` in `opencode.json`:
|
||||
Add the model under `providers.weave.models` in `opencode.json`:
|
||||
|
||||
```json
|
||||
"provider": {
|
||||
"weave": {
|
||||
"models": {
|
||||
"my-new-model": { "tools": true }
|
||||
"my-new-model": {
|
||||
"capabilities" {
|
||||
"tools": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,16 +122,17 @@ name** from that stack's compose and `<port>` is the container's *internal* port
|
||||
|
||||
### `opencode.json` keys
|
||||
|
||||
- **`model` / `small_model`** — default model and the model used for lighter
|
||||
tasks. Both default to `weave/glm-5.2`.
|
||||
- **`provider.weave`** — the weave provider, using the
|
||||
`@ai-sdk/openai-compatible` adapter against `http://weave-proxy/v1`.
|
||||
- **`provider.weave.models`** — the models offered in `/models`.
|
||||
- **`lsp`** — language servers baked into the image:
|
||||
`typescript-language-server` for TS/JS and `pyright` for Python.
|
||||
- **`permission`** — set to `ask` for read, edit, bash, and external-directory
|
||||
- **`model`** — default model.
|
||||
- **`agents.title.model`** — model used to generate session titles (replaces deprecated `small_model`)
|
||||
- **`providers.weave`** — the weave provider, using the
|
||||
`@opencode/ai/providers/openai-compatible` adapter against `https://weave.redpencil.io/v1`
|
||||
with the key from `WEAVE_API_KEY`.
|
||||
- **`providers.weave.models`** — the models offered in `/models`.
|
||||
- **`permissions`** — set to `ask` for read, edit, bash, and external-directory
|
||||
actions, so opencode prompts before acting.
|
||||
|
||||
Check-out https://opencode.ai/v2/docs/config/ for more options.
|
||||
|
||||
### Caveats
|
||||
|
||||
- Copy from the TUI over Docker needs the `Shift`+click / `Ctrl`+`Shift`+`C`
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
proxy_pass https://weave.redpencil.io;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_set_header Host weave.redpencil.io;
|
||||
proxy_set_header Authorization "Bearer ${WEAVE_API_KEY}";
|
||||
proxy_buffering off; # SSE streaming
|
||||
proxy_read_timeout 600s; # match opencode's 5-min defaults
|
||||
}
|
||||
}
|
||||
@@ -1,75 +1,83 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"model": "weave/glm-5.3-flash",
|
||||
"small_model": "weave/glm-5.3-flash",
|
||||
"lsp": {
|
||||
"typescript": {
|
||||
"command": [
|
||||
"typescript-language-server",
|
||||
"--stdio"
|
||||
],
|
||||
"extensions": [
|
||||
".ts",
|
||||
".tsx",
|
||||
".js",
|
||||
".jsx",
|
||||
".mjs",
|
||||
".cjs",
|
||||
".mts",
|
||||
".cts"
|
||||
]
|
||||
},
|
||||
"pyright": {
|
||||
"command": [
|
||||
"pyright-langserver",
|
||||
"--stdio"
|
||||
],
|
||||
"extensions": [
|
||||
".py",
|
||||
".pyi"
|
||||
]
|
||||
"agents": {
|
||||
"title": {
|
||||
"model": "weave/glm-5.3-flash"
|
||||
}
|
||||
},
|
||||
"provider": {
|
||||
"providers": {
|
||||
"weave": {
|
||||
"npm": "@ai-sdk/openai-compatible",
|
||||
"options": {
|
||||
"baseURL": "http://weave-proxy/v1",
|
||||
"apiKey": "not-needed"
|
||||
"package": "@opencode/ai/providers/openai-compatible",
|
||||
"settings": {
|
||||
"baseURL": "https://weave.redpencil.io/v1",
|
||||
"apiKey": "{env:WEAVE_API_KEY}"
|
||||
},
|
||||
"models": {
|
||||
"kimi-K2.7-code": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
},
|
||||
"glm-5.3": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
},
|
||||
"glm-5.3-flash": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
},
|
||||
"mistral-glm-5.2": {
|
||||
"tools": true,
|
||||
"reasoning": true,
|
||||
"options": {
|
||||
"capabilities": {
|
||||
"tools": true,
|
||||
"reasoning": {
|
||||
"supported": true
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"reasoningEffort": "xhigh"
|
||||
}
|
||||
},
|
||||
"devstral": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
},
|
||||
"local-qwen3.6:27b": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
},
|
||||
"mistral-medium": {
|
||||
"tools": true
|
||||
"capabilities": {
|
||||
"tools": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"read": "ask",
|
||||
"edit": "ask",
|
||||
"bash": "ask",
|
||||
"external_directory": "ask"
|
||||
}
|
||||
"permissions": [
|
||||
{
|
||||
"action": "read",
|
||||
"resource": "*",
|
||||
"effect": "ask",
|
||||
},
|
||||
{
|
||||
"action": "edit",
|
||||
"resource": "*",
|
||||
"effect": "ask",
|
||||
},
|
||||
{
|
||||
"action": "shell",
|
||||
"resource": "*",
|
||||
"effect": "ask",
|
||||
},
|
||||
{
|
||||
"action": "external_directory",
|
||||
"resource": "*",
|
||||
"effect": "ask",
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
services:
|
||||
weave-proxy:
|
||||
image: nginx:1.31.7-alpine
|
||||
volumes:
|
||||
- ./config/nginx/templates:/etc/nginx/templates:ro
|
||||
opencode:
|
||||
image: redpencil/opencode:0.0.2
|
||||
image: redpencil/opencode:feature-opencode-v2
|
||||
volumes:
|
||||
- ./data/opencode/share:/root/.local/share/opencode
|
||||
- ./config/opencode/opencode.json:/root/.config/opencode/opencode.json
|
||||
|
||||
Reference in New Issue
Block a user