Skip to content

Multi-LLM: consult Claude / GPT / Z.ai GLM (Assistant + hrp consult) - #60

Merged
digitalflanker-ux merged 2 commits into
mainfrom
feat/multi-llm
Jun 28, 2026
Merged

Multi-LLM: consult Claude / GPT / Z.ai GLM (Assistant + hrp consult)#60
digitalflanker-ux merged 2 commits into
mainfrom
feat/multi-llm

Conversation

@digitalflanker-ux

@digitalflanker-ux digitalflanker-ux commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Adds the ability to consult multiple LLM providers, not only Anthropic.

Shared provider layer (hrp/llm)

  • A registry of model specs with one complete() entry point — used by the Vault Assistant, the new /api/consult endpoint, and hrp consult. Also the deeper fix for ad-hoc Anthropic clients scattered across the codebase.
  • Providers: claude (Anthropic), gpt (OpenAI), glm (Z.ai — OpenAI-compatible via a custom base_url).
  • Model ids / endpoints / keys / default are all HRP_LLM_* env-overridable.

Surfaces

  • Vault Assistant: POST /api/assistant/query takes an optional model; new GET /api/assistant/models lists providers + availability; the answer reports which model replied. Web app gains a MODEL selector (unavailable providers disabled).
  • Consult tool (ungrounded): POST /api/consult + GET /api/consult/models, and a hrp consult "..." [--model gpt] [--list-models] CLI.
  • 400 on unknown model, 503 when a provider isn't configured (graceful), upstream errors sanitized.

Config

  • dep: openai>=1.30. .env.example documents OPENAI_API_KEY / ZAI_API_KEY + HRP_LLM_* overrides. Keep the keys you want; others stay disabled.

Verification

  • hrp/llm registry unit tests + assistant model-selection + consult tests; 45 API/LLM tests pass; ruff/black clean.
  • Live: /api/assistant/models lists all 3 (Claude available, GPT/GLM need keys); selector renders and defaults to the available provider; consult 503s without a key.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BFeBAuxWTFRayNGMD7VDn


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

digitalflanker-ux and others added 2 commits June 28, 2026 15:28
Adds a shared hrp/llm provider registry so the Vault Assistant, a new
/api/consult endpoint, and `hrp consult` can use any configured model — not just
Anthropic. Also the deeper fix for ad-hoc Anthropic clients scattered across the
codebase: one complete() entry point.

- hrp/llm: registry of model specs (claude=anthropic, gpt=openai, glm=Z.ai via
  the OpenAI SDK with a custom base_url). Model ids / endpoints / keys / default
  are all HRP_LLM_* env-overridable. complete()/list_models()/is_available().
- Assistant: POST /api/assistant/query takes an optional `model`; new
  GET /api/assistant/models lists providers + availability; answer reports which
  model replied. 400 unknown model, 503 provider not configured.
- Consult (ungrounded): POST /api/consult + GET /api/consult/models, and a
  `hrp consult "..." [--model gpt] [--list-models]` CLI.
- deps: openai>=1.30; .env.example documents OPENAI_API_KEY / ZAI_API_KEY +
  HRP_LLM_* overrides.
- Tests: hrp/llm registry unit tests + assistant model-selection + consult tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BFeBAuxWTFRayNGMD7VDn
The Assistant now lets you choose which LLM answers. Fetches
GET /api/assistant/models on mount, renders a compact MODEL select in the input
row (unavailable providers disabled + "(no key)"), defaults to the first
available model, sends the chosen model with each query, and shows "via <label>"
under each answer. Existing 503/429/loading states preserved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BFeBAuxWTFRayNGMD7VDn
@digitalflanker-ux
digitalflanker-ux merged commit cba381e into main Jun 28, 2026
1 check passed
@digitalflanker-ux
digitalflanker-ux deleted the feat/multi-llm branch June 28, 2026 20:43
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