mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-04 02:46:23 +00:00
updated opencode config
This commit is contained in:
+17
-4
@@ -25,6 +25,9 @@ docker exec -it ollama ollama run llama3
|
|||||||
|
|
||||||
WEBUI_SECRET_KEY is just a random secret string used to secure sessions, cookies, and auth in your WebUI. ```openssl rand -hex 32```
|
WEBUI_SECRET_KEY is just a random secret string used to secure sessions, cookies, and auth in your WebUI. ```openssl rand -hex 32```
|
||||||
|
|
||||||
|
You could also set OLLAMA_KEEP_ALIVE=5m if you are running multiple models. 5m is default, 0 removes as soon as done (then would have to reload model, so not quick), more than 5m is longer (minutes).
|
||||||
|
See "Docker Container Cheatsheet" below for how to remove models from memory.
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
- [Ollama Models](https://ollama.com/search)
|
- [Ollama Models](https://ollama.com/search)
|
||||||
@@ -44,17 +47,27 @@ ollamac list
|
|||||||
Standard commands
|
Standard commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Enter a shell
|
||||||
|
docker exec -it ollama-ollama-1 sh
|
||||||
|
|
||||||
# Add/Pull a model
|
# Add/Pull a model
|
||||||
docker exec -it ollama-ollama-1 ollama pull llama3.1:8b
|
ollama pull llama3.1:8b
|
||||||
|
|
||||||
# list models
|
# list models
|
||||||
docker compose exec -it ollama ollama list
|
ollama list
|
||||||
|
|
||||||
# Remove a model
|
# Remove a model
|
||||||
docker compose exec -it ollama ollama rm <model-name>
|
ollama rm <model-name>
|
||||||
|
|
||||||
# Run CLI
|
# Run CLI
|
||||||
docker compose exec -it ollama ollama run deebseek-r1:8b "What is Star Trek?"
|
ollama run <model-name> "What is Star Trek?"
|
||||||
|
|
||||||
|
# See what's running
|
||||||
|
ollama ps
|
||||||
|
|
||||||
|
# Clear memory
|
||||||
|
ollama stop <model-name>
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ services:
|
|||||||
- OPENCODE_PORT=${OPENCODE_PORT:-4096}
|
- OPENCODE_PORT=${OPENCODE_PORT:-4096}
|
||||||
- OPENCODE_HOSTNAME=${OPENCODE_HOSTNAME:-0.0.0.0}
|
- OPENCODE_HOSTNAME=${OPENCODE_HOSTNAME:-0.0.0.0}
|
||||||
- OPENCODE_CONFIG=/config/config.json
|
- OPENCODE_CONFIG=/config/config.json
|
||||||
- OPENCODE_MODEL=ollama/qwen3:8b-16k
|
- OPENCODE_MODEL=qwen3:8b-16k
|
||||||
- OLLAMA_HOST=http://10.1.1.16:11434
|
- OLLAMA_HOST=${OLLAMA_HOST_URL:-http://localhost:11434}
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "${OPENCODE_PORT:-4096}:4096"
|
- "${OPENCODE_PORT:-4096}:4096"
|
||||||
|
|
||||||
command: ["serve", "--hostname", "0.0.0.0", "--port", "4096"]
|
command: ["serve", "--port", "${OPENCODE_PORT:-4096}"]
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"model": "ollama/qwen3:8b-16k",
|
"model": "qwen3:8b-16k",
|
||||||
"provider": {
|
"provider": {
|
||||||
"ollama": {
|
"ollama": {
|
||||||
"npm": "@ai-sdk/openai-compatible",
|
"npm": "@ai-sdk/openai-compatible",
|
||||||
"options": {
|
"options": {
|
||||||
"baseURL": "http://10.1.1.16:11434/v1"
|
"baseURL": "http://localhost:11434/api/v1"
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
"qwen3:8b-16k": {
|
"qwen3:8b-16k": {
|
||||||
"tools": true
|
"name": "Qwen3 8B (16k UI-Context)",
|
||||||
|
"tools": true,
|
||||||
|
"limit": {
|
||||||
|
"maxTokens": 8192
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ OPENCODE_RESTART=unless-stopped
|
|||||||
VOL_PATH=/home/youruser/.local/share
|
VOL_PATH=/home/youruser/.local/share
|
||||||
OPENCODE_PORT=4096
|
OPENCODE_PORT=4096
|
||||||
OPENCODE_HOSTNAME=0.0.0.0
|
OPENCODE_HOSTNAME=0.0.0.0
|
||||||
|
OLLAMA_HOST=http://localhost:11434
|
||||||
Reference in New Issue
Block a user