feat: multi-provider model support via majordomo (local Ollama, OpenAI-compatible, etc.)
Build & push image / build-and-push (push) Successful in 18s
Build & push image / build-and-push (push) Successful in 18s
Replace the hardcoded ollama.Cloud binding with majordomo's provider registry, so Gadfly can target any backend majordomo supports without code changes. - cmd/gadfly/model.go: resolveModel() — GADFLY_PROVIDER (default ollama-cloud) prefixes bare model ids; GADFLY_MODEL may be a full provider/model spec, alias, or failover chain (verbatim). GADFLY_BASE_URL constructs openai/ollama/anthropic/ google directly at a custom endpoint (OpenAI-compatible + local/remote Ollama). GADFLY_API_KEY else the provider's standard env var. + buildSpec unit tests. - run.sh: provider-aware key gate (local Ollama needs none); maps OLLAMA_CLOUD_API_KEY -> OLLAMA_API_KEY; provider/base-url/key inherited by the binary. Gadfly-branded comment. - entrypoint.sh: GADFLY_MODELS alias for OLLAMA_REVIEW_MODELS; provider passthrough. - examples + README: Models & providers section. Upfront: only the Ollama paths (local + OpenAI-compatible-against-Ollama) are tested; OpenAI/Anthropic/Google are wired via majordomo but UNTESTED (no spend). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,27 @@ jobs:
|
||||
OLLAMA_CLOUD_API_KEY: ${{ secrets.OLLAMA_CLOUD_API_KEY }}
|
||||
OLLAMA_REVIEW_MODELS: ${{ vars.OLLAMA_REVIEW_MODELS }}
|
||||
GADFLY_ALLOWED_USERS: ${{ vars.GADFLY_ALLOWED_USERS }}
|
||||
# --- Models & providers (optional; default = Ollama Cloud) ----------
|
||||
# Gadfly is majordomo-powered, so it can target other backends. Set a
|
||||
# provider for bare model ids; point at a different endpoint with a
|
||||
# base URL; supply a key (or the provider's standard env var). Examples:
|
||||
#
|
||||
# Local Ollama daemon (no key):
|
||||
# GADFLY_PROVIDER: ollama
|
||||
# GADFLY_MODELS: qwen2.5-coder:7b
|
||||
# # GADFLY_BASE_URL: http://my-ollama-host:11434 # if not localhost
|
||||
#
|
||||
# OpenAI-compatible endpoint (incl. local Ollama's /v1):
|
||||
# GADFLY_PROVIDER: openai
|
||||
# GADFLY_BASE_URL: http://localhost:11434/v1
|
||||
# GADFLY_MODELS: qwen2.5-coder:7b
|
||||
#
|
||||
# OpenAI / Anthropic / Google (supported via majordomo, UNTESTED — see README):
|
||||
# GADFLY_PROVIDER: openai # then set OPENAI_API_KEY below
|
||||
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
GADFLY_PROVIDER: ${{ vars.GADFLY_PROVIDER }}
|
||||
GADFLY_BASE_URL: ${{ vars.GADFLY_BASE_URL }}
|
||||
GADFLY_MODELS: ${{ vars.GADFLY_MODELS }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR: ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
||||
PR_BRANCH: ${{ github.head_ref }}
|
||||
|
||||
Reference in New Issue
Block a user