Skip to content
Open
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
22 changes: 22 additions & 0 deletions crates/forge_domain/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -106,6 +107,7 @@ impl ProviderId {
ProviderId::FIREWORKS_AI,
ProviderId::NOVITA,
ProviderId::GOOGLE_AI_STUDIO,
ProviderId::MODAL,
]
}

Expand All @@ -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};
Expand Down Expand Up @@ -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())),
};
Expand Down Expand Up @@ -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";
Expand Down
20 changes: 20 additions & 0 deletions crates/forge_repo/src/provider/provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
Loading