Skip to content

Commit 6c0e93e

Browse files
micspiralmichaelnealenpub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67dTyler Longwell
authored
feat(desktop): use collective mesh routing for Auto (#2825)
Uses MeshLLM built-in `mesh` collective intelligence / Mixture of Agents when Buzz Auto sees two or more distinct physical models. With zero or one model, Auto remains ordinary `auto`. This is an alternative way to improve tool responses, accuracy, and resistance to hallucination when a high-latency distributed mesh contains diverse models. Models and members may come and go: collective routing enables only after stable capacity, drops on confirmed contraction, and can recover later. Mesh-specific failures retry once through ordinary Auto. This update also pins MeshLLM to a v0.73.1-compatible backport of [MeshLLM #1074](Mesh-LLM/mesh-llm#1074), so client-only Buzz nodes cannot enter model election or download a remote provider model. Buzz preserves the selected local sharing model and switches an existing client to sharing across a controlled app restart, retaining one runtime and one `:9337` / `:3131` pair per machine. Validation: - Full local `just ci` passes on the cleaned branch. - MeshLLM host-runtime suite: 1,568 passed, 0 failed; strict Clippy passes. - Buzz desktop Tauri suite with `mesh-llm`: 1,721 passed, 0 failed; strict feature Clippy passes. - Playwright covers client-to-share using the saved local model and no destructive stop. - Packaged two-machine testing proved single-model routing, dual-model collective routing, tool-markup fallback, and runtime reuse. - Packaged client-only recheck routed a real Mini Buzz turn through M5 while Mini stayed `is_client=true`, `is_host=false`, hosted no models, and created no Gemma cache. Builds on the recovery work merged in #2823; this PR does not duplicate it. --------- Signed-off-by: Michael Neale <[email protected]> Signed-off-by: Tyler Longwell <[email protected]> Co-authored-by: Michael Neale <[email protected]> Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <[email protected]>
1 parent 02227d7 commit 6c0e93e

22 files changed

Lines changed: 2304 additions & 609 deletions

‎crates/buzz-agent/src/config.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,12 @@ pub struct Config {
726726
pub anthropic_api_version: String,
727727
/// OpenAI endpoint selection. See [`OpenAiApi`].
728728
pub openai_api: OpenAiApi,
729+
/// Prefer mesh-llm's virtual `mesh` model when the configured/effective
730+
/// OpenAI model is `auto` and the live model catalog advertises it.
731+
/// Set by Buzz's relay-mesh provider via
732+
/// `BUZZ_AGENT_PREFER_MESH_FOR_AUTO=1`; other providers keep their
733+
/// existing `auto` semantics.
734+
pub prefer_mesh_for_auto: bool,
729735
pub hints_enabled: bool,
730736
/// Thinking/reasoning effort level. `None` = use provider default (no
731737
/// thinking config sent). Set via `BUZZ_AGENT_THINKING_EFFORT`.
@@ -798,6 +804,7 @@ impl Config {
798804
base_url,
799805
anthropic_api_version: env_or("ANTHROPIC_API_VERSION", "2023-06-01"),
800806
openai_api,
807+
prefer_mesh_for_auto: parse_env("BUZZ_AGENT_PREFER_MESH_FOR_AUTO", 0u8)? != 0,
801808
max_rounds: parse_env("BUZZ_AGENT_MAX_ROUNDS", 0)?,
802809
max_output_tokens: parse_env("BUZZ_AGENT_MAX_OUTPUT_TOKENS", 32_768)?,
803810
llm_timeout: Duration::from_secs(parse_env("BUZZ_AGENT_LLM_TIMEOUT_SECS", 240)?),
@@ -844,6 +851,7 @@ impl Config {
844851
system_prompt: String::new(),
845852
anthropic_api_version: "2023-06-01".into(),
846853
openai_api: OpenAiApi::Chat,
854+
prefer_mesh_for_auto: false,
847855
max_rounds: 0,
848856
max_output_tokens: 1,
849857
llm_timeout: Duration::from_secs(30),

‎crates/buzz-agent/src/llm.rs‎

Lines changed: 1048 additions & 96 deletions
Large diffs are not rendered by default.

‎desktop/src-tauri/Cargo.lock‎

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎desktop/src-tauri/Cargo.toml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ buzz_persona_pkg = { package = "buzz-persona", path = "../../crates/buzz-persona
9090
buzz_sdk_pkg = { package = "buzz-sdk", path = "../../crates/buzz-sdk" }
9191
buzz_agent_pkg = { package = "buzz-agent", path = "../../crates/buzz-agent" }
9292
iroh = { version = "1.0.2", optional = true }
93-
mesh-llm-sdk = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-sdk", default-features = false, features = ["client", "serving"], optional = true }
94-
mesh-llm-host-runtime = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-host-runtime", default-features = false, features = ["dynamic-native-runtime"], optional = true }
93+
mesh-llm-sdk = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-sdk", default-features = false, features = ["client", "serving"], optional = true }
94+
mesh-llm-host-runtime = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-host-runtime", default-features = false, features = ["dynamic-native-runtime"], optional = true }
9595
# Model catalog + hardware survey for the Share-compute model picker (same
9696
# diagnose pattern as mesh-console). Lib name of mesh-llm-client is mesh_client.
97-
mesh-llm-client = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-client", optional = true }
98-
mesh-llm-node = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-node", optional = true }
99-
mesh-llm-system = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-system", optional = true }
100-
mesh-llm-events = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "c441ea7f328692b18b7f49ad819c7b1a603cbdcb", package = "mesh-llm-events", optional = true }
97+
mesh-llm-client = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-client", optional = true }
98+
mesh-llm-node = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-node", optional = true }
99+
mesh-llm-system = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-system", optional = true }
100+
mesh-llm-events = { git = "https://github.com/Mesh-LLM/mesh-llm.git", rev = "f455d493a2ae82baf2a326e2d0fda351433b4b30", package = "mesh-llm-events", optional = true }
101101
base64 = "0.22"
102102
sha2 = "0.11"
103103
tar = "0.4"

0 commit comments

Comments
 (0)