diff --git a/crates/forge_domain/src/provider.rs b/crates/forge_domain/src/provider.rs index a65b43e416..be7498c7e2 100644 --- a/crates/forge_domain/src/provider.rs +++ b/crates/forge_domain/src/provider.rs @@ -73,6 +73,7 @@ impl ProviderId { pub const FIREWORKS_AI: ProviderId = ProviderId(Cow::Borrowed("fireworks-ai")); pub const NOVITA: ProviderId = ProviderId(Cow::Borrowed("novita")); pub const GOOGLE_AI_STUDIO: ProviderId = ProviderId(Cow::Borrowed("google_ai_studio")); + pub const MODAL: ProviderId = ProviderId(Cow::Borrowed("modal")); /// Returns all built-in provider IDs /// @@ -106,6 +107,7 @@ impl ProviderId { ProviderId::FIREWORKS_AI, ProviderId::NOVITA, ProviderId::GOOGLE_AI_STUDIO, + ProviderId::MODAL, ] } @@ -132,6 +134,7 @@ impl ProviderId { "fireworks-ai" => "FireworksAI".to_string(), "novita" => "Novita".to_string(), "google_ai_studio" => "GoogleAIStudio".to_string(), + "modal" => "Modal".to_string(), _ => { // For other providers, use UpperCamelCase conversion use convert_case::{Case, Casing}; @@ -177,6 +180,7 @@ impl std::str::FromStr for ProviderId { "fireworks-ai" => ProviderId::FIREWORKS_AI, "novita" => ProviderId::NOVITA, "google_ai_studio" => ProviderId::GOOGLE_AI_STUDIO, + "modal" => ProviderId::MODAL, // For custom providers, use Cow::Owned to avoid memory leaks custom => ProviderId(Cow::Owned(custom.to_string())), }; @@ -581,6 +585,24 @@ mod tests { assert_eq!(actual, expected); } + #[test] + fn test_modal_from_str() { + let actual = ProviderId::from_str("modal").unwrap(); + let expected = ProviderId::MODAL; + assert_eq!(actual, expected); + } + + #[test] + fn test_modal_display_name() { + assert_eq!(ProviderId::MODAL.to_string(), "Modal"); + } + + #[test] + fn test_modal_in_built_in_providers() { + let built_in = ProviderId::built_in_providers(); + assert!(built_in.contains(&ProviderId::MODAL)); + } + #[test] fn test_io_intelligence() { let fixture = "test_key"; diff --git a/crates/forge_repo/src/provider/provider.json b/crates/forge_repo/src/provider/provider.json index 16dc7899f6..e0f6f9d24d 100644 --- a/crates/forge_repo/src/provider/provider.json +++ b/crates/forge_repo/src/provider/provider.json @@ -3099,5 +3099,25 @@ "input_modalities": ["text"] } ] + }, + { + "id": "modal", + "api_key_vars": "MODAL_API_KEY", + "url_param_vars": [], + "response_type": "OpenAI", + "url": "https://api.us-west-2.modal.direct/v1/chat/completions", + "models": [ + { + "id": "zai-org/GLM-5-FP8", + "name": "GLM-5", + "description": "Z.ai's 745B parameter flagship open-source MoE model for long-horizon agents and systems engineering, hosted on Modal", + "context_length": 192000, + "tools_supported": true, + "supports_parallel_tool_calls": true, + "supports_reasoning": true, + "input_modalities": ["text"] + } + ], + "auth_methods": ["api_key"] } ]