refactor(goose-local-inference): move mlx deps under macos (#11328)

This commit is contained in:
Theofanis Petkos
2026-08-19 21:14:06 +00:00
committed by GitHub
parent e43f2be9b1
commit c509e2fa34
3 changed files with 6 additions and 7 deletions
+2 -3
View File
@@ -45,12 +45,11 @@ tracing = { workspace = true }
uuid = { workspace = true, features = ["v4", "std"] }
tempfile = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
llama-cpp-2 = { workspace = true, features = ["sampler", "metal", "mtmd"] }
safemlx = { default-features = false, features = ["accelerate", "metal", "safetensors"], optional = true, version = "0.1.2" }
safemlx-lm = { optional = true, version = "0.1.5" }
safemlx-lm-utils = { optional = true, version = "0.1.2" }
[target.'cfg(target_os = "macos")'.dependencies]
llama-cpp-2 = { workspace = true, features = ["sampler", "metal", "mtmd"] }
[dev-dependencies]
env-lock.workspace = true
@@ -1842,14 +1842,14 @@ fn mlx_config_support(config: &Option<serde_json::Value>) -> Option<String> {
mlx_config_support_for_value(config)
}
#[cfg(feature = "mlx")]
#[cfg(all(feature = "mlx", target_os = "macos"))]
fn mlx_config_support_for_value(config: &serde_json::Value) -> Option<String> {
safemlx_lm::check_model_config(config)
.unsupported_reason()
.map(str::to_string)
}
#[cfg(not(feature = "mlx"))]
#[cfg(not(all(feature = "mlx", target_os = "macos")))]
fn mlx_config_support_for_value(_config: &serde_json::Value) -> Option<String> {
None
}
+2 -2
View File
@@ -1,4 +1,4 @@
#[cfg(feature = "mlx")]
#[cfg(all(feature = "mlx", target_os = "macos"))]
mod imp {
use std::any::Any;
use std::path::{Path, PathBuf};
@@ -990,7 +990,7 @@ mod imp {
}
}
#[cfg(not(feature = "mlx"))]
#[cfg(not(all(feature = "mlx", target_os = "macos")))]
mod imp {
use crate::backend::{BackendLoadedModel, LocalGenerationRequest, LocalInferenceBackend};
use crate::local_model_registry::ModelSettings;