-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add core AI MITM proxy daemon #21296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
67307de
c1825d6
1651bbe
c90790f
db9ee42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1217,6 +1217,10 @@ func (c *DeploymentValues) Options() serpent.OptionSet { | |
| Name: "AI Bridge", | ||
| YAML: "aibridge", | ||
| } | ||
| deploymentGroupAIBridgeProxy = serpent.Group{ | ||
| Name: "AI Bridge Proxy", | ||
| YAML: "aibridgeproxy", | ||
| } | ||
| deploymentGroupRetention = serpent.Group{ | ||
| Name: "Retention", | ||
| Description: "Configure data retention policies for various database tables. Retention policies automatically purge old data to reduce database size and improve performance. Setting a retention duration to 0 disables automatic purging for that data type.", | ||
|
|
@@ -3443,6 +3447,49 @@ Write out the current server config as YAML to stdout.`, | |
| Group: &deploymentGroupAIBridge, | ||
| YAML: "rateLimit", | ||
| }, | ||
|
|
||
| // AI Bridge Proxy Options | ||
| { | ||
| Name: "AI Bridge Proxy Enabled", | ||
| Description: "Enable the AI Bridge MITM Proxy for intercepting and decrypting AI provider requests.", | ||
| Flag: "aibridge-proxy-enabled", | ||
| Env: "CODER_AIBRIDGE_PROXY_ENABLED", | ||
| Value: &c.AI.BridgeProxyConfig.Enabled, | ||
| Default: "false", | ||
| Group: &deploymentGroupAIBridgeProxy, | ||
| YAML: "enabled", | ||
| }, | ||
| { | ||
| Name: "AI Bridge Proxy Listen Address", | ||
| Description: "The address the AI Bridge Proxy will listen on.", | ||
| Flag: "aibridge-proxy-listen-addr", | ||
| Env: "CODER_AIBRIDGE_PROXY_LISTEN_ADDR", | ||
| Value: &c.AI.BridgeProxyConfig.ListenAddr, | ||
| Default: ":8888", | ||
| Group: &deploymentGroupAIBridgeProxy, | ||
| YAML: "listen_addr", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if we have a convention for yaml between snake_case and camelCase, as I see some options of aibridge with both, for instance,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, it should be underscore. Would you mind raising an issue to address these inconsistencies with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added an issue here: coder/internal#1205 |
||
| }, | ||
| { | ||
| Name: "AI Bridge Proxy Certificate File", | ||
| Description: "Path to the CA certificate file for AI Bridge Proxy.", | ||
| Flag: "aibridge-proxy-cert-file", | ||
| Env: "CODER_AIBRIDGE_PROXY_CERT_FILE", | ||
| Value: &c.AI.BridgeProxyConfig.CertFile, | ||
| Default: "", | ||
| Group: &deploymentGroupAIBridgeProxy, | ||
| YAML: "cert_file", | ||
| }, | ||
| { | ||
| Name: "AI Bridge Proxy Key File", | ||
| Description: "Path to the CA private key file for AI Bridge Proxy.", | ||
| Flag: "aibridge-proxy-key-file", | ||
| Env: "CODER_AIBRIDGE_PROXY_KEY_FILE", | ||
| Value: &c.AI.BridgeProxyConfig.KeyFile, | ||
| Default: "", | ||
| Group: &deploymentGroupAIBridgeProxy, | ||
| YAML: "key_file", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to confirm, do we need to set this as a secret? Something like: |
||
| }, | ||
|
|
||
| // Retention settings | ||
| { | ||
| Name: "Audit Logs Retention", | ||
|
|
@@ -3535,8 +3582,16 @@ type AIBridgeBedrockConfig struct { | |
| SmallFastModel serpent.String `json:"small_fast_model" typescript:",notnull"` | ||
| } | ||
|
|
||
| type AIBridgeProxyConfig struct { | ||
| Enabled serpent.Bool `json:"enabled" typescript:",notnull"` | ||
| ListenAddr serpent.String `json:"listen_addr" typescript:",notnull"` | ||
| CertFile serpent.String `json:"cert_file" typescript:",notnull"` | ||
| KeyFile serpent.String `json:"key_file" typescript:",notnull"` | ||
| } | ||
|
|
||
| type AIConfig struct { | ||
| BridgeConfig AIBridgeConfig `json:"bridge,omitempty"` | ||
| BridgeConfig AIBridgeConfig `json:"bridge,omitempty"` | ||
| BridgeProxyConfig AIBridgeProxyConfig `json:"aibridge_proxy,omitempty"` | ||
| } | ||
|
|
||
| type SupportConfig struct { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there is a better standard for a proxy port 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8080is kinda common because HTTP is80, but I don't think it matters.I think we listen on
8080already for our web frontend in dev mode; might make things complicated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly, that is why I kept this as
8888.