This page collects contributor-facing notes for extending nanobot. User-facing setup and runtime options live in [`configuration.md`](./configuration.md).
nanobot uses the provider registry in `nanobot/providers/registry.py` as the source of truth for LLM provider metadata. Most OpenAI-compatible providers need only two changes.
Every `ProviderSpec` must declare `request_apis`. This lists request formats implemented by the adapter; endpoint and model support are configured separately through connection and preset API declarations. Use `anthropic_messages` for native Anthropic adapters, `bedrock_converse` for Bedrock, and `transcription` for transcription-only providers.
`resolve_provider_route` in `nanobot/providers/routing.py` validates connection and preset declarations and selects the adapter. Built-in OpenAI connection declarations set an overridable default; custom connection declarations also limit the preset's allowed APIs.
`ProviderSpec.default_model_api` resolves automatic model rules from the registry. Copilot uses the account's last successfully discovered `supported_endpoints` when available. The WebUI preview calls `resolve_automatic_model_api` without probing endpoints or consulting circuit-breaker state; it reports a preference, not a guarantee of remote support.
Custom presets selecting `anthropic_messages` use the Anthropic adapter for history, tools, thinking, and streaming. They retain the connection's credentials, base URL, headers, query parameters, body additions, proxy, and model-prefix rules. Reasoning replay and native compaction remain provider-owned; a Responses declaration alone does not enable OpenAI-native compaction on a custom gateway.
Provider integrations must supply `ProviderSpec.request_apis`. Replace the former `responses_models` argument with `responses=ResponsesCapabilities(models=(...))`. Use `models` for rules shared by an endpoint and its proxies. For a rule tied to a specific endpoint, use `endpoint_models`:
Endpoint rules compare the URL origin and path, treating an optional trailing `/v1` as equivalent. Explicit preset API declarations override automatic rules.
Replace `OpenAICompatProvider(api_type=...)` with `OpenAICompatProvider(model_api=...)`. Omitting `model_api` preserves automatic selection. To require Responses, pass:
These types are defined in `nanobot.providers.registry`. The temporary `apiType` configuration migration applies to JSON configuration and Settings inputs; it does not preserve the old Python constructor arguments.
For transcription-only providers, set `is_transcription_only=True` so they show up in credential/settings surfaces but stay out of chat model selection.
Adapters receive resolved credentials and settings. They return an empty string for provider errors so channel voice messages fail quietly instead of crashing the agent loop.
Add the provider to [`configuration.md`](./configuration.md) where users choose `transcription.provider`, but keep implementation details in this development guide.