Commit graph

4 commits

Author SHA1 Message Date
Atte149
4fe15324c8 feat: multi-provider support — Ollama Cloud + OpenCode Go
- Account.Provider field (ollama-cloud | opencode-go), backward compatible
- Model-based routing: common models served by combined pool, unique models
  routed to their provider only
- /go/v1/* path forces OpenCode Go provider (prefix stripped upstream)
- Merged /v1/models endpoint returns union of both catalogs (44 models)
- Failover: 429/402 → cooldown + failover; 5xx → retry without cooldown
- CLI: accounts add --provider flag, list shows provider column
- Body buffering: request body buffered (8 MiB cap) for failover replay
- opencode integration: unified provider 'oc' with all merged models
- 64 tests pass (unit + integration)
- Verified: glm-5 → ollama, mimo-v2.5 → go, gpt-oss:20b → ollama
2026-06-24 15:37:28 +03:00
Atte149
98bbc96bf5 docs: separate opencode vs openlama provider isolation
- opencode (global config) sees marg/fireworks only, no ocp
- openlama (OPENCODE_CONFIG=openlama.json) sees ocp only via enabled_providers
- Verified: opencode run -m ocp/... → Model not found; openlama run -m ocp/... → OK
- openlama launcher sets OPENCODE_CONFIG + NO_PROXY + execs opencode
2026-06-19 14:18:14 +03:00
Atte149
c8974d9998 docs: document openlama launcher and NO_PROXY requirement
- openlama wrapper at ~/.local/bin/openlama sets NO_PROXY and execs opencode
- Documents that opencode does not auto-fetch /v1/models (models must be listed)
- Documents the NO_PROXY fix for Bun runtime + HTTP_PROXY conflict
2026-06-19 14:08:28 +03:00
Atte149
3963eede70 feat: ollama-proxy — multi-account Ollama Cloud reverse proxy
Go reverse proxy for ollama.com that balances requests across multiple
API keys with round-robin and failover on 429/5xx. Exposes both native
Ollama API (/api/*) and OpenAI-compatible (/v1/*) passthrough.

- Round-robin balancer with per-account cooldown (60s default)
- Pre-stream failover: 429 → cooldown + next account; 5xx → next account
- Streaming invariant: once 2xx starts streaming, no account switch
- SSE (text/event-stream) and NDJSON passthrough with http.Flusher
- CLI: accounts add/list/remove/set-base-url, serve, version
- Accounts stored in ~/.config/ollama-proxy/accounts.json (chmod 0600)
- systemd unit (User=dueattendant149, 127.0.0.1:11435, Restart=always)
- 43 tests (unit + integration with httptest upstream)
- opencode integration: custom provider 'ocp' with explicit model list
- Requires NO_PROXY=127.0.0.1,localhost when HTTP_PROXY is set
2026-06-19 13:58:13 +03:00