@@ -500,6 +500,7 @@ type DeploymentValues struct {
500
500
WorkspaceHostnameSuffix serpent.String `json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`
501
501
Prebuilds PrebuildsConfig `json:"workspace_prebuilds,omitempty" typescript:",notnull"`
502
502
HideAITasks serpent.Bool `json:"hide_ai_tasks,omitempty" typescript:",notnull"`
503
+ AI AIConfig `json:"ai,omitempty"`
503
504
504
505
Config serpent.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
505
506
WriteConfig serpent.Bool `json:"write_config,omitempty" typescript:",notnull"`
@@ -1163,6 +1164,10 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
1163
1164
Parent :& deploymentGroupNotifications ,
1164
1165
YAML :"inbox" ,
1165
1166
}
1167
+ deploymentGroupAIBridge = serpent.Group {
1168
+ Name :"AIBridge" ,
1169
+ YAML :"aibridge" ,
1170
+ }
1166
1171
)
1167
1172
1168
1173
httpAddress := serpent.Option {
@@ -3223,11 +3228,88 @@ Write out the current server config as YAML to stdout.`,
3223
3228
Group :& deploymentGroupClient ,
3224
3229
YAML :"hideAITasks" ,
3225
3230
},
3231
+
3232
+ // AIBridge Options
3233
+ {
3234
+ Name :"AIBridge Enabled" ,
3235
+ Description :fmt .Sprintf ("Whether to start an in-memory aibridged instance (%q experiment must be enabled, too)." ,ExperimentAIBridge ),
3236
+ Flag :"aibridge-enabled" ,
3237
+ Env :"CODER_AIBRIDGE_ENABLED" ,
3238
+ Value :& c .AI .BridgeConfig .Enabled ,
3239
+ Default :"false" ,
3240
+ Group :& deploymentGroupAIBridge ,
3241
+ YAML :"enabled" ,
3242
+ Hidden :false ,
3243
+ },
3244
+ {
3245
+ Name :"AIBridge OpenAI Base URL" ,
3246
+ Description :"The base URL of the OpenAI API." ,
3247
+ Flag :"aibridge-openai-base-url" ,
3248
+ Env :"CODER_AIBRIDGE_OPENAI_BASE_URL" ,
3249
+ Value :& c .AI .BridgeConfig .OpenAI .BaseURL ,
3250
+ Default :"https://api.openai.com/v1/" ,
3251
+ Group :& deploymentGroupAIBridge ,
3252
+ YAML :"openai_base_url" ,
3253
+ Hidden :true ,
3254
+ },
3255
+ {
3256
+ Name :"AIBridge OpenAI Key" ,
3257
+ Description :"The key to authenticate against the OpenAI API." ,
3258
+ Flag :"aibridge-openai-key" ,
3259
+ Env :"CODER_AIBRIDGE_OPENAI_KEY" ,
3260
+ Value :& c .AI .BridgeConfig .OpenAI .Key ,
3261
+ Default :"" ,
3262
+ Group :& deploymentGroupAIBridge ,
3263
+ YAML :"openai_key" ,
3264
+ Hidden :true ,
3265
+ },
3266
+ {
3267
+ Name :"AIBridge Anthropic Base URL" ,
3268
+ Description :"The base URL of the Anthropic API." ,
3269
+ Flag :"aibridge-anthropic-base-url" ,
3270
+ Env :"CODER_AIBRIDGE_ANTHROPIC_BASE_URL" ,
3271
+ Value :& c .AI .BridgeConfig .Anthropic .BaseURL ,
3272
+ Default :"https://api.anthropic.com/" ,
3273
+ Group :& deploymentGroupAIBridge ,
3274
+ YAML :"base_url" ,
3275
+ Hidden :true ,
3276
+ },
3277
+ {
3278
+ Name :"AIBridge Anthropic KEY" ,
3279
+ Description :"The key to authenticate against the Anthropic API." ,
3280
+ Flag :"aibridge-anthropic-key" ,
3281
+ Env :"CODER_AIBRIDGE_ANTHROPIC_KEY" ,
3282
+ Value :& c .AI .BridgeConfig .Anthropic .Key ,
3283
+ Default :"" ,
3284
+ Group :& deploymentGroupAIBridge ,
3285
+ YAML :"key" ,
3286
+ Hidden :true ,
3287
+ },
3226
3288
}
3227
3289
3228
3290
return opts
3229
3291
}
3230
3292
3293
+ type AIBridgeConfig struct {
3294
+ Enabled serpent.Bool `json:"enabled" typescript:",notnull"`
3295
+ OpenAI AIBridgeOpenAIConfig `json:"openai" typescript:",notnull"`
3296
+ Anthropic AIBridgeAnthropicConfig `json:"anthropic" typescript:",notnull"`
3297
+ }
3298
+
3299
+ type AIBridgeOpenAIConfig struct {
3300
+ BaseURL serpent.String `json:"base_url" typescript:",notnull"`
3301
+ Key serpent.String `json:"key" typescript:",notnull"`
3302
+ }
3303
+
3304
+ type AIBridgeAnthropicConfig struct {
3305
+ BaseURL serpent.String `json:"base_url" typescript:",notnull"`
3306
+ Key serpent.String `json:"key" typescript:",notnull"`
3307
+ }
3308
+
3309
+ type AIConfig struct {
3310
+ BridgeConfig AIBridgeConfig `json:"bridge,omitempty"`
3311
+ }
3312
+
3231
3313
type SupportConfig struct {
3232
3314
Links serpent.Struct [[]LinkConfig ]`json:"links" typescript:",notnull"`
3233
3315
}
@@ -3475,6 +3557,7 @@ const (
3475
3557
ExperimentOAuth2 Experiment = "oauth2" // Enables OAuth2 provider functionality.
3476
3558
ExperimentMCPServerHTTP Experiment = "mcp-server-http" // Enables the MCP HTTP server functionality.
3477
3559
ExperimentWorkspaceSharing Experiment = "workspace-sharing" // Enables updating workspace ACLs for sharing with users and groups.
3560
+ ExperimentAIBridge Experiment = "aibridge" // Enables AI Bridge functionality.
3478
3561
)
3479
3562
3480
3563
func (e Experiment )DisplayName ()string {
@@ -3495,6 +3578,8 @@ func (e Experiment) DisplayName() string {
3495
3578
return "MCP HTTP Server Functionality"
3496
3579
case ExperimentWorkspaceSharing :
3497
3580
return "Workspace Sharing"
3581
+ case ExperimentAIBridge :
3582
+ return "AI Bridge"
3498
3583
default :
3499
3584
// Split on hyphen and convert to title case
3500
3585
// e.g. "web-push" -> "Web Push", "mcp-server-http" -> "Mcp Server Http"
@@ -3513,6 +3598,7 @@ var ExperimentsKnown = Experiments{
3513
3598
ExperimentOAuth2 ,
3514
3599
ExperimentMCPServerHTTP ,
3515
3600
ExperimentWorkspaceSharing ,
3601
+ ExperimentAIBridge ,
3516
3602
}
3517
3603
3518
3604
// ExperimentsSafe should include all experiments that are safe for