Skip to content

Add support for more LLM providers#6365

Closed
calvinmclean wants to merge 8 commits intomainfrom
feature/llm-providers
Closed

Add support for more LLM providers#6365
calvinmclean wants to merge 8 commits intomainfrom
feature/llm-providers

Conversation

@calvinmclean
Copy link
Copy Markdown
Contributor

@calvinmclean calvinmclean commented Apr 16, 2026

Addresses #6195

This is merging into a feature branch that already has updated handling for the llmProvider configuration in Nanobot. This re-enables model providers in the UI and updates documentation.

The first two commits are already reviewed as previous PRs. All new changes are squashed into the 3rd commit which can be reviewed independently.

Depends on:

TODO:

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 16, 2026

Deploying obot with  Cloudflare Pages  Cloudflare Pages

Latest commit: f9408d9
Status: ✅  Deploy successful!
Preview URL: https://f9713b7a.obot-dvt.pages.dev
Branch Preview URL: https://feature-llm-providers.obot-dvt.pages.dev

View logs

@calvinmclean calvinmclean force-pushed the feature/llm-providers branch from 1c4198f to 7eea8ec Compare April 16, 2026 23:43
Comment thread go.mod Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands Obot/Nanobot support for additional LLM providers by propagating a provider “dialect” through API types, model manifests, and Nanobot configuration, while re-enabling/ordering providers in the UI and updating provider documentation.

Changes:

  • Add Dialect to provider metadata and model manifests, and propagate it through model back-population and Nanobot agent credential/config generation.
  • Update LLM proxy and message policy enforcement flow to share message-policy evaluation logic and pass enforcement context into response handling.
  • Update UI provider availability/sorting plus docs, and adjust model-provider model listing URL handling.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ui/user/src/routes/admin/model-providers/+page.svelte Marks additional providers as “Nanobot integrated” for UI availability.
ui/user/src/lib/sort.ts Updates preferred provider ordering to include Azure + Entra providers.
ui/user/src/lib/constants.ts Adds new provider IDs and expands the “recommended” provider set.
apiclient/types/modelprovider.go Adds CommonProviderMetadata.Dialect.
apiclient/types/model.go Adds ModelManifest.Dialect.
pkg/storage/openapi/generated/openapi_generated.go Regenerates OpenAPI schemas to include new fields (and dependency-driven schema changes).
pkg/controller/handlers/toolreference/toolreference.go Pulls dialect from provider metadata and stamps it onto created Models; uses env-aware model listing.
pkg/gateway/server/dispatcher/availablemodels.go Fixes /v1/models construction via JoinPath and base-path normalization.
pkg/controller/handlers/nanobotagent/nanobotagent.go Generates Nanobot provider YAML per resolved default models/providers and persists it as NANOBOT_CONFIG.
pkg/controller/handlers/nanobotagent/nanobotagent_test.go Adds coverage for dialect-driven Nanobot provider parsing/YAML generation.
pkg/api/handlers/nanobotagent.go Treats missing NANOBOT_CONFIG similarly to missing NANOBOT_ENV_FILE during launch retries.
pkg/gateway/server/llmproxy.go Centralizes message policy evaluation (input + output) and wires results into response modification.
pkg/messagepolicy/evaluate.go Adds dialect-aware branching for policy-evaluation LLM calls and generalizes SSE parsing helper.
pkg/mcp/backend.go Renames Nanobot YAML constructors for MCP server proxy config; avoids name shadowing.
pkg/mcp/kubernetes.go Renames MCP server Nanobot YAML constructors and clarifies comments.
pkg/mcp/docker.go Refactors init-container logic into a shared helper and renames MCP-server Nanobot config volume logic.
docs/docs/configuration/model-providers.md Updates Azure provider docs (API key vs Entra) and Ollama endpoint guidance.
go.mod / go.sum Large dependency upgrades (notably Kubernetes + cloud SDK stacks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/messagepolicy/evaluate.go Outdated
Comment thread pkg/messagepolicy/evaluate.go
Comment thread pkg/controller/handlers/nanobotagent/nanobotagent.go
Comment thread docs/docs/configuration/model-providers.md
Comment thread pkg/messagepolicy/evaluate.go
* Write .nanobot/nanobot.yaml llmProviders

* Simplify docker volume/container inits with runInitContainer

* Update some naming to make it clear it is MCP config only

* Use Nanobot types when building config

* Dynamically build the nanobot.yaml for selected model

* Derive Dialect from provider meta

* Fix name shadowing

* Update go.mod using remote branch

* Generate

* Fix default proxy for ChatCompletions and add tests

* Fix provider config reload with symbolic link

* Improve function naming

* Improve function naming and other minor changes

* Improve ensureCredentials refresh logic

* Add Dialect to ModelManifest

* regenerate

* Always run link for docker

* Revert use of nanobottypes

* PR comments

* Move all config setup to nanobotagent.go

* fix boolean condition per copilot comment

* Fix error retry check
* Add Bifrost provider dialect

* Enable bedrock provider in UI

* Enable Ollama in UI

* Enable Azure, AzureEntra in UI

* Update docs

* Update Nanobot branch

* Improve docs for Azure Entra

* fix go mod issue

* Resolve PR comments

* fix go mod

* Improve Ollama networking doc for linux users
@calvinmclean calvinmclean force-pushed the feature/llm-providers branch from 70e0dc7 to f254ffd Compare April 20, 2026 19:21
WIP deps

Rename NANOBOT_CONFIG_PATH => NANOBOT_CONFIG

Fix MessagePolicy for Bifrost

Extract and reuse message policies code

Include env in BackPopulateModels

- This allows the Azure provider to get updated deployments

Update kinm + nah

improve docs

lint

generate

Improve URL handling
@calvinmclean calvinmclean force-pushed the feature/llm-providers branch from f254ffd to 6cbf77e Compare April 20, 2026 19:25
@calvinmclean calvinmclean marked this pull request as ready for review April 20, 2026 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread go.mod Outdated
Comment thread go.mod Outdated
Comment thread pkg/gateway/server/llmproxy.go
Co-authored-by: Donnie Adams <donnie@obot.ai>
Copilot AI review requested due to automatic review settings April 21, 2026 21:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/gateway/server/llmproxy.go
Comment thread pkg/controller/handlers/nanobotagent/nanobotagent.go
Copilot AI review requested due to automatic review settings April 22, 2026 19:08
@calvinmclean calvinmclean enabled auto-merge (squash) April 22, 2026 19:17
@calvinmclean calvinmclean disabled auto-merge April 22, 2026 19:18
@calvinmclean calvinmclean deleted the feature/llm-providers branch April 22, 2026 19:19
@calvinmclean calvinmclean review requested due to automatic review settings April 22, 2026 19:28
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.

4 participants