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