Skip to content

Commit 89174d6

Browse files
gonzogaforge-code-agentautofix-ci[bot]amitksingh1490
authored
fix(provider): meta muse spark 1.1 provider (#3688)
Co-authored-by: ForgeCode <noreply@forgecode.dev> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Amit Singh <amitksingh1490@gmail.com>
1 parent 5651ae4 commit 89174d6

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,21 @@ ORCAROUTER_API_KEY=<your_orcarouter_api_key>
590590

591591
</details>
592592

593+
<details>
594+
<summary><strong>Meta</strong></summary>
595+
596+
```bash
597+
# .env
598+
META_API_KEY=<your_meta_model_api_key>
599+
```
600+
601+
```yaml
602+
# forge.yaml
603+
model: muse-spark-1.1
604+
```
605+
606+
</details>
607+
593608
<details>
594609
<summary><strong>IO Intelligence</strong></summary>
595610

crates/forge_domain/src/provider.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl ProviderId {
8484
pub const AMBIENT: ProviderId = ProviderId(Cow::Borrowed("ambient"));
8585
pub const NEURALWATT: ProviderId = ProviderId(Cow::Borrowed("neuralwatt"));
8686
pub const ORCA_ROUTER: ProviderId = ProviderId(Cow::Borrowed("orca_router"));
87+
pub const META: ProviderId = ProviderId(Cow::Borrowed("meta"));
8788

8889
/// Returns all built-in provider IDs
8990
///
@@ -127,6 +128,7 @@ impl ProviderId {
127128
ProviderId::AMBIENT,
128129
ProviderId::NEURALWATT,
129130
ProviderId::ORCA_ROUTER,
131+
ProviderId::META,
130132
]
131133
}
132134

@@ -164,6 +166,7 @@ impl ProviderId {
164166
"ambient" => "Ambient".to_string(),
165167
"neuralwatt" => "Neuralwatt".to_string(),
166168
"orca_router" => "OrcaRouter".to_string(),
169+
"meta" => "Meta".to_string(),
167170
_ => {
168171
// For other providers, use UpperCamelCase conversion
169172
use convert_case::{Case, Casing};
@@ -222,6 +225,7 @@ impl std::str::FromStr for ProviderId {
222225
"ambient" => ProviderId::AMBIENT,
223226
"neuralwatt" => ProviderId::NEURALWATT,
224227
"orca_router" => ProviderId::ORCA_ROUTER,
228+
"meta" => ProviderId::META,
225229
// For custom providers, use Cow::Owned to avoid memory leaks
226230
custom => ProviderId(Cow::Owned(custom.to_string())),
227231
};
@@ -600,6 +604,7 @@ mod tests {
600604
assert_eq!(ProviderId::NVIDIA.to_string(), "NVIDIA");
601605
assert_eq!(ProviderId::AMBIENT.to_string(), "Ambient");
602606
assert_eq!(ProviderId::ORCA_ROUTER.to_string(), "OrcaRouter");
607+
assert_eq!(ProviderId::META.to_string(), "Meta");
603608
}
604609

605610
#[test]
@@ -642,6 +647,7 @@ mod tests {
642647
assert!(built_in.contains(&ProviderId::NVIDIA));
643648
assert!(built_in.contains(&ProviderId::AMBIENT));
644649
assert!(built_in.contains(&ProviderId::ORCA_ROUTER));
650+
assert!(built_in.contains(&ProviderId::META));
645651
}
646652

647653
#[test]
@@ -759,6 +765,24 @@ mod tests {
759765
assert!(built_in.contains(&ProviderId::ORCA_ROUTER));
760766
}
761767

768+
#[test]
769+
fn test_meta_from_str() {
770+
let actual = ProviderId::from_str("meta").unwrap();
771+
let expected = ProviderId::META;
772+
assert_eq!(actual, expected);
773+
}
774+
775+
#[test]
776+
fn test_meta_display_name() {
777+
assert_eq!(ProviderId::META.to_string(), "Meta");
778+
}
779+
780+
#[test]
781+
fn test_meta_in_built_in_providers() {
782+
let built_in = ProviderId::built_in_providers();
783+
assert!(built_in.contains(&ProviderId::META));
784+
}
785+
762786
#[test]
763787
fn test_io_intelligence() {
764788
let fixture = "test_key";

crates/forge_repo/src/provider/provider.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,5 +4097,25 @@
40974097
"url": "https://api.orcarouter.ai/v1/chat/completions",
40984098
"models": "https://api.orcarouter.ai/v1/models",
40994099
"auth_methods": ["api_key"]
4100+
},
4101+
{
4102+
"id": "meta",
4103+
"api_key_vars": "META_API_KEY",
4104+
"url_param_vars": [],
4105+
"response_type": "OpenAIResponses",
4106+
"url": "https://api.meta.ai/v1/responses",
4107+
"models": [
4108+
{
4109+
"id": "muse-spark-1.1",
4110+
"name": "Muse Spark 1.1",
4111+
"description": "Meta's multimodal model for agentic tool calling, coding, structured output, image and video understanding, and long-context reasoning",
4112+
"context_length": 1048576,
4113+
"tools_supported": true,
4114+
"supports_parallel_tool_calls": true,
4115+
"supports_reasoning": true,
4116+
"input_modalities": ["text", "image"]
4117+
}
4118+
],
4119+
"auth_methods": ["api_key"]
41004120
}
41014121
]

crates/forge_repo/src/provider/provider_repo.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,56 @@ mod tests {
957957
}
958958
}
959959

960+
#[test]
961+
fn test_meta_config() {
962+
let configs = get_provider_configs();
963+
let config = configs.iter().find(|c| c.id == ProviderId::META).unwrap();
964+
assert_eq!(config.id, ProviderId::META);
965+
assert_eq!(config.api_key_vars, Some("META_API_KEY".to_string()));
966+
assert!(config.url_param_vars.is_empty());
967+
assert_eq!(
968+
config.response_type,
969+
Some(ProviderResponse::OpenAIResponses)
970+
);
971+
assert_eq!(config.url.as_str(), "https://api.meta.ai/v1/responses");
972+
973+
match config.models.as_ref().expect("models should be present") {
974+
Models::Hardcoded(models) => {
975+
let model = models
976+
.iter()
977+
.find(|m| m.id.as_str() == "muse-spark-1.1")
978+
.expect("muse-spark-1.1 should be present in hardcoded models");
979+
assert_eq!(
980+
model.context_length,
981+
Some(1048576),
982+
"muse-spark-1.1 should have 1048576 context length"
983+
);
984+
assert_eq!(
985+
model.tools_supported,
986+
Some(true),
987+
"muse-spark-1.1 should support tools"
988+
);
989+
assert_eq!(
990+
model.supports_parallel_tool_calls,
991+
Some(true),
992+
"muse-spark-1.1 should support parallel tool calls"
993+
);
994+
assert_eq!(
995+
model.supports_reasoning,
996+
Some(true),
997+
"muse-spark-1.1 should support reasoning"
998+
);
999+
assert!(
1000+
model
1001+
.input_modalities
1002+
.contains(&forge_app::domain::InputModality::Image),
1003+
"muse-spark-1.1 should support image input"
1004+
);
1005+
}
1006+
other => panic!("expected hardcoded models, got {other:?}"),
1007+
}
1008+
}
1009+
9601010
#[test]
9611011
fn test_provider_entry_with_static_models_converts_to_hardcoded() {
9621012
let model = forge_domain::Model::new("Qwen3.6-35B-A3b-q3-mlx")

0 commit comments

Comments
 (0)