Skip to content

feat: custom LLM provider#20

Open
taylorelley wants to merge 1 commit intosaolalab:mainfrom
taylorelley:feat/custom-llm-provider
Open

feat: custom LLM provider#20
taylorelley wants to merge 1 commit intosaolalab:mainfrom
taylorelley:feat/custom-llm-provider

Conversation

@taylorelley
Copy link
Copy Markdown

Adds a UI-configurable Custom (OpenAI-compatible) LLM provider so users can point an agent at any OpenAI-compatible endpoint (e.g. vLLM, LM Studio, a self-hosted gateway) by entering a Base URL, API key, and model name.

Description

  • Backend: route models with the custom/ prefix through CustomProvider in clawbot/core/config/schema.py, and strip that prefix before calling the upstream endpoint in clawbot/providers/custom_provider.py.
  • API: extend ListModelsRequest with api_base and add a custom branch to /api/providers/models in clawforce/apis/providers.py that lists models from the configured base URL with optional bearer auth.
  • UI: register the provider in ModelProviderSection.tsx, add the Base URL input, and thread api_base through listModels in lib/api.ts and the supporting agent-detail components.
  • Rebuilt static assets under clawforce/static/.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • My code follows the project's style guidelines (run make lint)
  • I have run the test suite locally (run make test)
  • I have updated the documentation if needed
  • My changes generate no new warnings

Adds a UI-configurable Custom (OpenAI-compatible) LLM provider so users
can point an agent at any OpenAI-compatible endpoint (e.g. vLLM, LM
Studio, a self-hosted gateway) by entering a Base URL, API key, and
model name — no code changes or redeploys required.

- Backend: route models with the `custom/` prefix through CustomProvider
  in `clawbot/core/config/schema.py`, and strip that prefix before calling
  the upstream endpoint in `clawbot/providers/custom_provider.py`.
- API: extend `ListModelsRequest` with `api_base` and add a `custom`
  branch to `/api/providers/models` in `clawforce/apis/providers.py` that
  lists models from the configured base URL with optional bearer auth.
- UI: register the provider in `ModelProviderSection.tsx`, add the Base
  URL input, and thread `api_base` through `listModels` in `lib/api.ts`
  and the supporting agent-detail components.
- Rebuilt static assets under `clawforce/static/`.
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.

2 participants