Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ OPTIONS:
Periodically check for new releases of Coder and inform the owner. The
check is performed once per day.

AIBRIDGE OPTIONS:
--aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: true)
Whether to start an in-memory aibridged instance ("aibridge"
experiment must be enabled, too).

CLIENT OPTIONS:
These options change the behavior of how clients interact with the Coder.
Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.
Expand Down
17 changes: 17 additions & 0 deletions cli/testdata/server-config.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -709,3 +709,20 @@ workspace_prebuilds:
# limit; disabled when set to zero.
# (default: 3, type: int)
failure_hard_limit: 3
aibridge:
# Whether to start an in-memory aibridged instance ("aibridge" experiment must be
# enabled, too).
# (default: true, type: bool)
enabled: true
# The base URL of the OpenAI API.
# (default: https://api.openai.com/v1/, type: string)
openai_base_url: https://api.openai.com/v1/
# The key to authenticate against the OpenAI API.
# (default: <unset>, type: string)
openai_key: ""
# The base URL of the Anthropic API.
# (default: https://api.anthropic.com/, type: string)
base_url: https://api.anthropic.com/
# The key to authenticate against the Anthropic API.
# (default: <unset>, type: string)
key: ""
54 changes: 52 additions & 2 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 52 additions & 2 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ type DeploymentValues struct {
WorkspaceHostnameSuffix serpent.String `json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`
Prebuilds PrebuildsConfig `json:"workspace_prebuilds,omitempty" typescript:",notnull"`
HideAITasks serpent.Bool `json:"hide_ai_tasks,omitempty" typescript:",notnull"`
AI AIConfig `json:"ai,omitempty"`

Config serpent.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
WriteConfig serpent.Bool `json:"write_config,omitempty" typescript:",notnull"`
Expand Down Expand Up @@ -1158,6 +1159,10 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
Parent: &deploymentGroupNotifications,
YAML: "inbox",
}
deploymentGroupAIBridge = serpent.Group{
Name: "AIBridge",
YAML: "aibridge",
}
)

httpAddress := serpent.Option{
Expand Down Expand Up @@ -3208,11 +3213,88 @@ Write out the current server config as YAML to stdout.`,
Group: &deploymentGroupClient,
YAML: "hideAITasks",
},

// AIBridge Options
{
Name: "AIBridge Enabled",
Description: fmt.Sprintf("Whether to start an in-memory aibridged instance (%q experiment must be enabled, too).", ExperimentAIBridge),
Flag: "aibridge-enabled",
Env: "CODER_AIBRIDGE_ENABLED",
Value: &c.AI.BridgeConfig.Enabled,
Default: "true",
Group: &deploymentGroupAIBridge,
YAML: "enabled",
Hidden: false,
},
{
Name: "AIBridge OpenAI Base URL",
Description: "The base URL of the OpenAI API.",
Flag: "aibridge-openai-base-url",
Env: "CODER_AIBRIDGE_OPENAI_BASE_URL",
Value: &c.AI.BridgeConfig.OpenAI.BaseURL,
Default: "https://api.openai.com/v1/",
Group: &deploymentGroupAIBridge,
YAML: "openai_base_url",
Hidden: true,
},
{
Name: "AIBridge OpenAI Key",
Description: "The key to authenticate against the OpenAI API.",
Flag: "aibridge-openai-key",
Env: "CODER_AIBRIDGE_OPENAI_KEY",
Value: &c.AI.BridgeConfig.OpenAI.Key,
Default: "",
Group: &deploymentGroupAIBridge,
YAML: "openai_key",
Hidden: true,
},
{
Name: "AIBridge Anthropic Base URL",
Description: "The base URL of the Anthropic API.",
Flag: "aibridge-anthropic-base-url",
Env: "CODER_AIBRIDGE_ANTHROPIC_BASE_URL",
Value: &c.AI.BridgeConfig.Anthropic.BaseURL,
Default: "https://api.anthropic.com/",
Group: &deploymentGroupAIBridge,
YAML: "base_url",
Hidden: true,
},
{
Name: "AIBridge Anthropic KEY",
Description: "The key to authenticate against the Anthropic API.",
Flag: "aibridge-anthropic-key",
Env: "CODER_AIBRIDGE_ANTHROPIC_KEY",
Value: &c.AI.BridgeConfig.Anthropic.Key,
Default: "",
Group: &deploymentGroupAIBridge,
YAML: "key",
Hidden: true,
},
}

return opts
}

type AIBridgeConfig struct {
Enabled serpent.Bool `json:"enabled" typescript:",notnull"`
OpenAI AIBridgeOpenAIConfig `json:"openai" typescript:",notnull"`
Anthropic AIBridgeAnthropicConfig `json:"anthropic" typescript:",notnull"`
}

type AIBridgeOpenAIConfig struct {
BaseURL serpent.String `json:"base_url" typescript:",notnull"`
Key serpent.String `json:"key" typescript:",notnull"`
}

type AIBridgeAnthropicConfig struct {
BaseURL serpent.String `json:"base_url" typescript:",notnull"`
Key serpent.String `json:"key" typescript:",notnull"`
}

type AIConfig struct {
BridgeConfig AIBridgeConfig `json:"bridge,omitempty"`
}

type SupportConfig struct {
Links serpent.Struct[[]LinkConfig] `json:"links" typescript:",notnull"`
}
Expand Down Expand Up @@ -3436,6 +3518,7 @@ const (
ExperimentOAuth2 Experiment = "oauth2" // Enables OAuth2 provider functionality.
ExperimentMCPServerHTTP Experiment = "mcp-server-http" // Enables the MCP HTTP server functionality.
ExperimentWorkspaceSharing Experiment = "workspace-sharing" // Enables updating workspace ACLs for sharing with users and groups.
ExperimentAIBridge Experiment = "aibridge" // Enables AI Bridge functionality.
)

func (e Experiment) DisplayName() string {
Expand All @@ -3456,6 +3539,8 @@ func (e Experiment) DisplayName() string {
return "MCP HTTP Server Functionality"
case ExperimentWorkspaceSharing:
return "Workspace Sharing"
case ExperimentAIBridge:
return "AI Bridge"
default:
// Split on hyphen and convert to title case
// e.g. "web-push" -> "Web Push", "mcp-server-http" -> "Mcp Server Http"
Expand All @@ -3474,6 +3559,7 @@ var ExperimentsKnown = Experiments{
ExperimentOAuth2,
ExperimentMCPServerHTTP,
ExperimentWorkspaceSharing,
ExperimentAIBridge,
}

// ExperimentsSafe should include all experiments that are safe for
Expand Down
13 changes: 13 additions & 0 deletions docs/reference/api/general.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading