mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
13bf0e11f1
> Mux prepared this PR on behalf of Mike. ## Stack Context This is PR 1 of 6 in the `mike/ai-providers` Graphite stack. The stack migrates Agents chat provider configuration from legacy chat provider tables to the unified AI provider tables used by the AI provider administration surface. See the stack comment for review order and links. ## What? Adds a package-level `coderd/x/chatd/docs.go` glossary for AI Providers, provider-scoped keys, user BYOK keys, and Agents as the consuming feature area. ## Why? Keeping the glossary next to chatd makes the migration language visible where Agents consume AI Providers, without adding a separate PRD, root context file, or ADR structure.
37 lines
1.9 KiB
Go
37 lines
1.9 KiB
Go
// Package chatd implements the internal chat service used by Agents.
|
|
//
|
|
// # Provider configuration glossary
|
|
//
|
|
// This package uses AI Provider language for new provider configuration code:
|
|
//
|
|
// - AI Provider: a database-backed LLM provider configuration stored in
|
|
// ai_providers. It is the source of truth for Agents provider identity.
|
|
// - Legacy Chat Provider: the pre-migration chat-specific provider source.
|
|
// Legacy rows only exist as migration input during the stack.
|
|
// - Provider Type: the provider implementation family stored in
|
|
// ai_providers.type, such as openai, anthropic, azure, bedrock, google,
|
|
// openai-compat, openrouter, and vercel.
|
|
// - Provider Name: the unique instance identifier stored in
|
|
// ai_providers.name. It is not the implementation family.
|
|
// - Model Config: an Agents model selection record. In the target state it
|
|
// references one concrete AI Provider by ID.
|
|
// - Provider-scoped AI Provider Key: an administrator-managed credential in
|
|
// ai_provider_keys, attached to one AI Provider.
|
|
// - User AI Provider Key: a user-owned credential attached to one user and
|
|
// one AI Provider.
|
|
// - BYOK: the deployment-level AI Bridge policy that controls whether user
|
|
// keys may be written or used. Disabling BYOK does not delete stored user
|
|
// keys.
|
|
// - AI Bridge: the product area that introduced AI provider records. Agents
|
|
// consume the same records through chatd, but this package does not define
|
|
// the full AI Bridge runtime roadmap.
|
|
//
|
|
// Model configs should use provider IDs for identity. Provider types choose
|
|
// runtime implementation details. Provider names are instance identifiers for
|
|
// administrators and APIs.
|
|
//
|
|
// When BYOK is enabled, a user key for the selected provider takes precedence
|
|
// over provider-scoped keys. When BYOK is disabled, chatd ignores user keys and
|
|
// uses provider-scoped keys only.
|
|
package chatd
|