From 308d7e394239efd4dfc01b9c6e0d32624361d631 Mon Sep 17 00:00:00 2001 From: gorkii Date: Wed, 5 Aug 2026 13:46:51 -0400 Subject: [PATCH] feat(router): add SaladCloud endpoint --- crates/braintrust-llm-router/README.md | 2 +- .../braintrust-llm-router/src/providers/openai.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/braintrust-llm-router/README.md b/crates/braintrust-llm-router/README.md index cb1409cc2..6bfaf75f4 100644 --- a/crates/braintrust-llm-router/README.md +++ b/crates/braintrust-llm-router/README.md @@ -83,7 +83,7 @@ async fn main() -> anyhow::Result<()> { | AWS Bedrock | AWS SigV4 | Yes | | | Azure OpenAI | API Key / Entra | Yes | | | Mistral | API Key | Yes | | -| OpenAI-compatible | API Key | Yes | Together, Groq, Perplexity, etc. | +| OpenAI-compatible | API Key | Yes | Together, Groq, Perplexity, SaladCloud, etc. | ## API reference diff --git a/crates/braintrust-llm-router/src/providers/openai.rs b/crates/braintrust-llm-router/src/providers/openai.rs index ef79b5791..2d96d0863 100644 --- a/crates/braintrust-llm-router/src/providers/openai.rs +++ b/crates/braintrust-llm-router/src/providers/openai.rs @@ -354,6 +354,7 @@ pub fn is_openai_compatible(kind: &str) -> bool { | "databricks" | "cohere" | "openrouter" + | "saladcloud" ) } @@ -411,6 +412,10 @@ pub fn openai_compatible_endpoint(kind: &str) -> Option Some(OpenAICompatibleEndpoint { + url: "https://ai.salad.cloud/v1", + is_template: false, + }), _ => None, } } @@ -460,4 +465,13 @@ mod tests { let url = provider.chat_url(None).expect("url"); assert!(url.as_str().contains("default.lepton.run")); } + + #[test] + fn recognizes_saladcloud_endpoint() { + assert!(is_openai_compatible("saladcloud")); + + let endpoint = openai_compatible_endpoint("saladcloud").expect("endpoint"); + assert_eq!(endpoint.url, "https://ai.salad.cloud/v1"); + assert!(!endpoint.is_template); + } }