[PR #1068] [CLOSED] AI companion (opt-in): a local AI teammate you can talk to #3020

Closed
opened 2026-11-02 16:00:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1068
Author: @ludovic111
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: feat/companion-polish2


📝 Commits (10+)

  • f7c8bb0 docs: companions design (local-first AI teammate, opt-in, No AI)
  • 5a7055e horizon-companion: catalogue, hardware tiers and resumable downloads
  • 54081d5 docs/companions: classifier stage, voice in v1 (Pocket TTS / Qwen3-TTS via audio.cpp, Parakeet push-to-talk), hardware plan
  • ce7932e horizon-companion: runtime supervisor, streaming client, reply schema
  • 69545bd horizon-companion: prompt builder and installer example
  • fa93944 horizon-companion: reflex rules, addressed-to and the three-stage pipeline
  • da06dc6 horizon-companion: phrase banks and callouts
  • fac77bf lan: connectionless guests for companions
  • 805dc51 companion: commands, reports, rules, file and state summary
  • 53fcba1 game: companion bodies, private hub and per-player skins

📊 Changes

137 files changed (+42912 additions, -412 deletions)

View changed files

📝 Cargo.lock (+53 -1)
📝 Cargo.toml (+1 -1)
📝 crates/horizon-client/Cargo.toml (+4 -0)
📝 crates/horizon-client/examples/lan_flat.rs (+1 -1)
📝 crates/horizon-client/src/advancements.rs (+191 -0)
📝 crates/horizon-client/src/audio.rs (+351 -2)
📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+10 -0)
➕ crates/horizon-client/src/companion/file.rs (+152 -0)
➕ crates/horizon-client/src/companion/gear.rs (+157 -0)
➕ crates/horizon-client/src/companion/mod.rs (+691 -0)
➕ crates/horizon-client/src/companion/summary.rs (+262 -0)
➕ crates/horizon-client/src/companion/work.rs (+576 -0)
➕ crates/horizon-client/src/companion_options.rs (+783 -0)
➕ crates/horizon-client/src/companion_voice.rs (+616 -0)
📝 crates/horizon-client/src/extras.rs (+16 -1)
📝 crates/horizon-client/src/front.rs (+42 -3)
📝 crates/horizon-client/src/game.rs (+49 -0)
📝 crates/horizon-client/src/game/advancements.rs (+58 -7)
📝 crates/horizon-client/src/game/chat.rs (+1 -0)
📝 crates/horizon-client/src/game/commands.rs (+44 -29)

...and 80 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

An opt-in AI companion: a player-like teammate that follows you, fights, mines, crafts, and talks back in
chat and out loud. It runs locally by default. Nothing spawns, downloads or starts unless the player turns it
on, and the No AI checkbox (launcher and game, kept in sync) hides every trace of it.

The design is in docs/companions.md.

How it works

  • Body: a server-side LAN guest driven by deterministic Rust skills on the server tick:
    • follow, fight, collect, give, craft (chains), smelt, sleep, mine and bows;
    • movement through MotionWorld and the vanilla PathFinder port.
  • Reflexes: the player's line goes through a three-stage pipeline:
    1. rules in 5 languages;
    2. a multilingual embedding classifier (multilingual-e5-small);
    3. the LLM, called only when the first two don't settle it.
  • Brain: a llama-server sidecar (llama.cpp), JSON-schema output {tone, say, actions[≤3], remember},
    streamed sentence by sentence. The model only picks skills and words; it can't cheat or stall the game.
  • Models, all Apache-2.0 and ungated:
    • Light: Qwen3.5-2B;
    • Standard: Qwen3.5-4B;
    • Strong: Qwen3.5-9B;
    • Best: gemma-4-12B-it QAT.
  • Voice: an audio.cpp sidecar.
    • TTS: Pocket TTS on the CPU. On GPUs, Qwen3-TTS cloning a cast of 12 designed voices: the 5
      personality defaults plus 7 more, each with 5 emotions in en and fr.
    • STT: Parakeet TDT 0.6B v3, with Canary 180M as the light fallback.
    • Delivery: push-to-talk on V, positional voice with a radio effect.
  • Fits the PC: plan() measures memory and the GPU and picks each model kind (brain, classifier, STT, TTS,
    guard). The simple view is one "Set up companion" button; Advanced shows and swaps everything. The launcher
    has the same card.
  • Roles: Assistant, Teammate, Speedrunner, Bodyguard, Coach.
  • Personalities: presets plus custom text, and live persona changes.
  • Memory: notes are kept in the world's companions/<uuid>.json.
  • Perception levels: Fair (default), Sharp senses, Scout, All-knowing.
  • Watch mode: the owner becomes a spectator camera following the companion through portals, with a timer,
    step and perception HUD.

Engine fixes found along the way (no companion code; useful on their own)

  • the dragon fight runs on server levels, deals vanilla damage and fights every player;
  • world spawn is known before the first save;
  • end crystal entity ids;
  • /summon reports TNT;
  • advancement criteria are indexed, and the log is written on its own thread (tick spikes).

Status: draft

This stack works in game (spawn → "follow me" → fight → "get me 10 wood" → jokes → push-to-talk in French),
with:

  • clippy -D warnings and tests passing on the touched crates;
  • tools/test_companion.py and the guest LAN harnesses passing.

Not done:

  • the voice pack (47 MB) isn't hosted yet;
  • es/de/pt/it clips;
  • measuring on an RTX 4080;
  • a real-mic test;
  • Windows/Linux launcher keychain checks;
  • THIRD_PARTY_NOTICES credits;
  • the boss bar and networked dragon for LAN guests.
  • Safety (guard model, Salty mode): a separate draft on top of this one.
  • Speedrun route (finish the game alone): a separate draft, still in progress.

Branch history: this is feat/companion-polish2, which merges feat/companion, -body, -brain, -senses,
-voices, -skills, -engine, -integ and -polish. Those are pushed too, for reference.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1068 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/companion-polish2` --- ### 📝 Commits (10+) - [`f7c8bb0`](https://github.com/horizon-rust/horizon/commit/f7c8bb0af2145fe2d6fb17196179f046b2c3c293) docs: companions design (local-first AI teammate, opt-in, No AI) - [`5a7055e`](https://github.com/horizon-rust/horizon/commit/5a7055e5126a52a94aabbd98c8ddbe0ec937c98f) horizon-companion: catalogue, hardware tiers and resumable downloads - [`54081d5`](https://github.com/horizon-rust/horizon/commit/54081d5169b59fb6e19d4f6cad1712ee32b3e4a1) docs/companions: classifier stage, voice in v1 (Pocket TTS / Qwen3-TTS via audio.cpp, Parakeet push-to-talk), hardware plan - [`ce7932e`](https://github.com/horizon-rust/horizon/commit/ce7932e9eee5f903d24902b210101019cd57c359) horizon-companion: runtime supervisor, streaming client, reply schema - [`69545bd`](https://github.com/horizon-rust/horizon/commit/69545bd5cc6cdf9dd462c63940b9c7c8e9a15f57) horizon-companion: prompt builder and installer example - [`fa93944`](https://github.com/horizon-rust/horizon/commit/fa939449590171eb6e6b7b4aeff35673965cdc57) horizon-companion: reflex rules, addressed-to and the three-stage pipeline - [`da06dc6`](https://github.com/horizon-rust/horizon/commit/da06dc61dbe250c254caa821702427f79c9f0f27) horizon-companion: phrase banks and callouts - [`fac77bf`](https://github.com/horizon-rust/horizon/commit/fac77bf305ebf40711e267fe78a493f1b521f0f5) lan: connectionless guests for companions - [`805dc51`](https://github.com/horizon-rust/horizon/commit/805dc51d6e71bcdbe98676b50c52f88f7eb78e6b) companion: commands, reports, rules, file and state summary - [`53fcba1`](https://github.com/horizon-rust/horizon/commit/53fcba1093e7ab6b574c7e7a96baedbf85dc11fa) game: companion bodies, private hub and per-player skins ### 📊 Changes **137 files changed** (+42912 additions, -412 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+53 -1) 📝 `Cargo.toml` (+1 -1) 📝 `crates/horizon-client/Cargo.toml` (+4 -0) 📝 `crates/horizon-client/examples/lan_flat.rs` (+1 -1) 📝 `crates/horizon-client/src/advancements.rs` (+191 -0) 📝 `crates/horizon-client/src/audio.rs` (+351 -2) 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+10 -0) ➕ `crates/horizon-client/src/companion/file.rs` (+152 -0) ➕ `crates/horizon-client/src/companion/gear.rs` (+157 -0) ➕ `crates/horizon-client/src/companion/mod.rs` (+691 -0) ➕ `crates/horizon-client/src/companion/summary.rs` (+262 -0) ➕ `crates/horizon-client/src/companion/work.rs` (+576 -0) ➕ `crates/horizon-client/src/companion_options.rs` (+783 -0) ➕ `crates/horizon-client/src/companion_voice.rs` (+616 -0) 📝 `crates/horizon-client/src/extras.rs` (+16 -1) 📝 `crates/horizon-client/src/front.rs` (+42 -3) 📝 `crates/horizon-client/src/game.rs` (+49 -0) 📝 `crates/horizon-client/src/game/advancements.rs` (+58 -7) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+44 -29) _...and 80 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What An **opt-in AI companion**: a player-like teammate that follows you, fights, mines, crafts, and talks back in chat and out loud. It runs locally by default. Nothing spawns, downloads or starts unless the player turns it on, and the **No AI** checkbox (launcher and game, kept in sync) hides every trace of it. The design is in `docs/companions.md`. ### How it works - **Body:** a server-side LAN guest driven by deterministic Rust skills on the server tick: - follow, fight, collect, give, craft (chains), smelt, sleep, mine and bows; - movement through MotionWorld and the vanilla PathFinder port. - **Reflexes:** the player's line goes through a three-stage pipeline: 1. rules in 5 languages; 2. a multilingual embedding classifier (multilingual-e5-small); 3. the LLM, called only when the first two don't settle it. - **Brain:** a `llama-server` sidecar (llama.cpp), JSON-schema output `{tone, say, actions[≤3], remember}`, streamed sentence by sentence. The model only picks skills and words; it can't cheat or stall the game. - **Models, all Apache-2.0 and ungated:** - Light: Qwen3.5-2B; - Standard: Qwen3.5-4B; - Strong: Qwen3.5-9B; - Best: gemma-4-12B-it QAT. - **Voice:** an audio.cpp sidecar. - **TTS:** Pocket TTS on the CPU. On GPUs, Qwen3-TTS cloning a cast of **12 designed voices**: the 5 personality defaults plus 7 more, each with 5 emotions in en and fr. - **STT:** Parakeet TDT 0.6B v3, with Canary 180M as the light fallback. - **Delivery:** push-to-talk on **V**, positional voice with a radio effect. - **Fits the PC:** `plan()` measures memory and the GPU and picks each model kind (brain, classifier, STT, TTS, guard). The simple view is one "Set up companion" button; Advanced shows and swaps everything. The launcher has the same card. - **Roles:** Assistant, Teammate, Speedrunner, Bodyguard, Coach. - **Personalities:** presets plus custom text, and live persona changes. - **Memory:** notes are kept in the world's `companions/<uuid>.json`. - **Perception levels:** Fair (default), Sharp senses, Scout, All-knowing. - **Watch mode:** the owner becomes a spectator camera following the companion through portals, with a timer, step and perception HUD. ### Engine fixes found along the way (no companion code; useful on their own) - the dragon fight runs on server levels, deals vanilla damage and fights every player; - world spawn is known before the first save; - end crystal entity ids; - `/summon` reports TNT; - advancement criteria are indexed, and the log is written on its own thread (tick spikes). ## Status: draft This stack works in game (spawn → "follow me" → fight → "get me 10 wood" → jokes → push-to-talk in French), with: - clippy `-D warnings` and tests passing on the touched crates; - `tools/test_companion.py` and the guest LAN harnesses passing. Not done: - the voice pack (47 MB) isn't hosted yet; - es/de/pt/it clips; - measuring on an RTX 4080; - a real-mic test; - Windows/Linux launcher keychain checks; - THIRD_PARTY_NOTICES credits; - the boss bar and networked dragon for LAN guests. ## Related PRs - **Safety** (guard model, Salty mode): a separate draft on top of this one. - **Speedrun route** (finish the game alone): a separate draft, still in progress. Branch history: this is `feat/companion-polish2`, which merges `feat/companion`, `-body`, `-brain`, `-senses`, `-voices`, `-skills`, `-engine`, `-integ` and `-polish`. Those are pushed too, for reference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:52 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3020
No description provided.