Skip to content
Merged
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
15 changes: 11 additions & 4 deletions crates/goose/src/providers/formats/gcpvertexai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ pub const KNOWN_MODELS: &[&str] = &[
"claude-sonnet-4@20250514",
"claude-3-5-haiku@20241022",
"claude-3-haiku@20240307",
"gemini-3.1-flash-lite",
"gemini-3.1-pro-preview",
"gemini-3-pro-preview",
"gemini-3-flash-preview",
"gemini-2.5-pro",
Expand Down Expand Up @@ -112,13 +114,15 @@ impl fmt::Display for GcpVertexAIModel {
impl GcpVertexAIModel {
/// Returns the default GCP location for the model.
///
/// Each model family has a well-known location based on availability:
/// - Claude models default to Ohio (us-east5)
/// - Gemini models default to Iowa (us-central1)
/// - MaaS models default to Iowa (us-central1)
/// Location routing by model family:
/// - Claude models: Ohio (us-east5)
/// - Gemini 3.x models: Global
/// - Other Gemini models: Iowa (us-central1)
/// - MaaS models: Iowa (us-central1)
pub fn known_location(&self) -> GcpLocation {
match self {
Self::Claude(_) => GcpLocation::Ohio,
Self::Gemini(name) if name.starts_with("gemini-3") => GcpLocation::Global,
Self::Gemini(_) => GcpLocation::Iowa,
Self::MaaS(_, _) => GcpLocation::Iowa,
}
Expand Down Expand Up @@ -369,6 +373,9 @@ mod tests {
let gemini_model = GcpVertexAIModel::try_from("gemini-2.5-flash")?;
assert_eq!(gemini_model.known_location(), GcpLocation::Iowa);

let gemini_3_model = GcpVertexAIModel::try_from("gemini-3.1-flash-lite")?;
assert_eq!(gemini_3_model.known_location(), GcpLocation::Global);

Ok(())
}

Expand Down
Loading