Skip to content

feat: support custom LLM endpoints for local AI servers#54

Open
max-baeumler wants to merge 2 commits intoknostic:masterfrom
schutzpunkt:master
Open

feat: support custom LLM endpoints for local AI servers#54
max-baeumler wants to merge 2 commits intoknostic:masterfrom
schutzpunkt:master

Conversation

@max-baeumler
Copy link
Copy Markdown

Add configurable base_url, model names, SSL verification, and extended timeouts so OpenAnt can run against any Anthropic-compatible API server (llama-swap, llama-server, vLLM, LM Studio, etc.) instead of requiring Anthropic's cloud API.

Changes:

Config (Go CLI):

  • Add base_url, opus_model, sonnet_model, verify_ssl to config.json
  • New config keys: base-url, opus-model, sonnet-model, verify-ssl
  • Pass settings to Python core via environment variables
  • Skip Anthropic API key validation when custom base_url is set

LLM client (Python core):

  • New utilities/config.py: resolve_model(), create_anthropic_client(), extract_text() helpers
  • All 8 direct anthropic.Anthropic() calls routed through factory
  • All 15+ hardcoded Claude model strings replaced with resolve_model()
  • Extended connect timeout (300s) for model cold-start / swap
  • Configurable SSL verification for self-signed certs
  • extract_text() handles thinking/reasoning model responses (ThinkingBlock before TextBlock)

Usage:

openant config set base-url # http://localhost:8080
openant config set api-key # any non-empty value
openant config set opus-model # e.g. qwen3:32b
openant config set sonnet-model # e.g. qwen3:8b
openant config set verify-ssl # false (for self-signed certs)
openant scan /path/to/repo

Fully backwards compatible — defaults to Anthropic cloud API with original Claude model names when no custom endpoint is configured.

Add configurable base_url, model names, SSL verification, and extended
timeouts so OpenAnt can run against any Anthropic-compatible API server
(llama-swap, llama-server, vLLM, LM Studio, etc.) instead of requiring
Anthropic's cloud API.

Changes:

  Config (Go CLI):
  - Add base_url, opus_model, sonnet_model, verify_ssl to config.json
  - New config keys: base-url, opus-model, sonnet-model, verify-ssl
  - Pass settings to Python core via environment variables
  - Skip Anthropic API key validation when custom base_url is set

  LLM client (Python core):
  - New utilities/config.py: resolve_model(), create_anthropic_client(),
    extract_text() helpers
  - All 8 direct anthropic.Anthropic() calls routed through factory
  - All 15+ hardcoded Claude model strings replaced with resolve_model()
  - Extended connect timeout (300s) for model cold-start / swap
  - Configurable SSL verification for self-signed certs
  - extract_text() handles thinking/reasoning model responses
    (ThinkingBlock before TextBlock)

Usage:

  openant config set base-url       # http://localhost:8080
  openant config set api-key        # any non-empty value
  openant config set opus-model     # e.g. qwen3:32b
  openant config set sonnet-model   # e.g. qwen3:8b
  openant config set verify-ssl     # false (for self-signed certs)
  openant scan /path/to/repo

Fully backwards compatible — defaults to Anthropic cloud API with
original Claude model names when no custom endpoint is configured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant