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
2 changes: 1 addition & 1 deletion crates/braintrust-llm-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions crates/braintrust-llm-router/src/providers/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ pub fn is_openai_compatible(kind: &str) -> bool {
| "databricks"
| "cohere"
| "openrouter"
| "saladcloud"
)
}

Expand Down Expand Up @@ -411,6 +412,10 @@ pub fn openai_compatible_endpoint(kind: &str) -> Option<OpenAICompatibleEndpoint
url: "https://openrouter.ai/api/v1",
is_template: false,
}),
"saladcloud" => Some(OpenAICompatibleEndpoint {
url: "https://ai.salad.cloud/v1",
is_template: false,
}),
_ => None,
}
}
Expand Down Expand Up @@ -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);
}
}