feat: feature-gate local inference dependencies (#7976)

Signed-off-by: DaeHee Lee <lee111dae11@proton.me>
Signed-off-by: jh-block <jhugo@block.xyz>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: jh-block <jhugo@block.xyz>
This commit is contained in:
이대희
2026-03-24 00:49:24 +09:00
committed by GitHub
parent 79f539f8af
commit c493c6160c
23 changed files with 372 additions and 100 deletions
+5
View File
@@ -865,6 +865,7 @@ enum Command {
command: TermCommand,
},
/// Manage local inference models
#[cfg(feature = "local-inference")]
#[command(about = "Manage local inference models", visible_alias = "lm")]
LocalModels {
#[command(subcommand)]
@@ -892,6 +893,7 @@ enum Command {
},
}
#[cfg(feature = "local-inference")]
#[derive(Subcommand)]
enum LocalModelsCommand {
/// Search HuggingFace for GGUF models
@@ -1013,6 +1015,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
Some(Command::Update { .. }) => "update",
Some(Command::Recipe { .. }) => "recipe",
Some(Command::Term { .. }) => "term",
#[cfg(feature = "local-inference")]
Some(Command::LocalModels { .. }) => "local-models",
Some(Command::Completion { .. }) => "completion",
Some(Command::ValidateExtensions { .. }) => "validate-extensions",
@@ -1473,6 +1476,7 @@ async fn handle_term_subcommand(command: TermCommand) -> Result<()> {
}
}
#[cfg(feature = "local-inference")]
async fn handle_local_models_command(command: LocalModelsCommand) -> Result<()> {
use goose::providers::local_inference::hf_models;
use goose::providers::local_inference::local_model_registry::{
@@ -1759,6 +1763,7 @@ pub async fn cli() -> anyhow::Result<()> {
}
Some(Command::Recipe { command }) => handle_recipe_subcommand(command),
Some(Command::Term { command }) => handle_term_subcommand(command).await,
#[cfg(feature = "local-inference")]
Some(Command::LocalModels { command }) => handle_local_models_command(command).await,
Some(Command::ValidateExtensions { file }) => {
use goose::agents::validate_extensions::validate_bundled_extensions;