[META] all hero apps consume LLM/voice via hero_lib AI client → hero_aibroker #219

Open
opened 2026-05-06 17:07:18 +00:00 by mik-tf · 2 comments
Owner

Overview

The Hero AI architecture is set: hero_lib exposes the SDK (one client, one API for chat/voice/embeddings), hero_aibroker is the only thing that talks to providers (Groq, OpenRouter, Anthropic, Kokoro, parakeet, …) and the only thing that downloads models. Apps never touch providers directly. The architecture exists and works — this META tracks adoption + tightening.

Why

Meeting 2026-05-06: "any app using latest ai client / hero_lib / has ai client / that ai client talks to ai broker / now ai broker download models / need to do it everywhere / all apps use ai client in hero_lib / make sure skills around that are optimal".

Sub-tasks

  • App migration audit — every app that has its own LLM call path → switch to hero_lib client. Known offenders:
    • hero_biz#15 — Route AiClient through local AI Broker (hero_biz_ui)
  • aibroker downloads models everywhere — apply the model-download pattern to every provider — hero_aibroker#62
  • Voice integration skill — canonical UI + transcription pattern for any app needing voice — hero_skills#219
  • hero_lib CI — fix CI as part of this work — hero_lib#134
  • Provider fallback chain — already filed: hero_aibroker#55 (resolves home#215 at the broker layer)

Acceptance

  • No app in lhumina_code/* instantiates a non-hero_lib LLM client
  • Every voice surface uses the canonical voice skill
  • aibroker's fallback chain is live (no more "Groq down → assistant dies")
  • hero_lib CI is green

Children

Source: meeting notes 2026-05-06.

## Overview The Hero AI architecture is set: `hero_lib` exposes the SDK (one client, one API for chat/voice/embeddings), `hero_aibroker` is the only thing that talks to providers (Groq, OpenRouter, Anthropic, Kokoro, parakeet, …) and the only thing that downloads models. Apps never touch providers directly. **The architecture exists and works — this META tracks adoption + tightening.** ## Why Meeting 2026-05-06: "any app using latest ai client / hero_lib / has ai client / that ai client talks to ai broker / now ai broker download models / need to do it everywhere / all apps use ai client in hero_lib / make sure skills around that are optimal". ## Sub-tasks - [ ] **App migration audit** — every app that has its own LLM call path → switch to hero_lib client. Known offenders: - [hero_biz#15](https://forge.ourworld.tf/lhumina_code/hero_biz/issues/15) — Route AiClient through local AI Broker (hero_biz_ui) - [ ] **aibroker downloads models everywhere** — apply the model-download pattern to every provider — [hero_aibroker#62](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/62) - [ ] **Voice integration skill** — canonical UI + transcription pattern for any app needing voice — [hero_skills#219](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/219) - [ ] **hero_lib CI** — fix CI as part of this work — [hero_lib#134](https://forge.ourworld.tf/lhumina_code/hero_lib/issues/134) - [ ] **Provider fallback chain** — already filed: [hero_aibroker#55](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/55) (resolves [home#215](https://forge.ourworld.tf/lhumina_code/home/issues/215) at the broker layer) ## Acceptance - [ ] No app in `lhumina_code/*` instantiates a non-hero_lib LLM client - [ ] Every voice surface uses the canonical voice skill - [ ] aibroker's fallback chain is live (no more "Groq down → assistant dies") - [ ] hero_lib CI is green ## Children - [hero_aibroker#62](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/62) — aibroker downloads models everywhere - [hero_skills#219](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/219) — voice integration skill canonical - [hero_voice#28](https://forge.ourworld.tf/lhumina_code/hero_voice/issues/28) — switch to parakeet - [hero_lib#134](https://forge.ourworld.tf/lhumina_code/hero_lib/issues/134) — fix CI ## Related - [hero_biz#15](https://forge.ourworld.tf/lhumina_code/hero_biz/issues/15) - [hero_aibroker#55](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/55) - [hero_aibroker#1](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/1) — smarter multi-key routing - [hero_aibroker#47](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/47) — refactor parent - [home#215](https://forge.ourworld.tf/lhumina_code/home/issues/215) — assistant non-functional (the symptom) Source: meeting notes 2026-05-06.
mik-tf added this to the ACTIVE project 2026-05-06 17:31:41 +00:00
Author
Owner

Adding another offender surfaced during session 65 of the home#212 build-binaries arc:

  • hero_lib_rhai/crates/ai_rhai — Rhai bindings that wrap herolib_ai. Bound to the pre-rewrite client API; 39 cargo check errors against current hero_lib development. Filed: lhumina_code/hero_lib_rhai#16

Worked around in session 65 by rev-pinning all 14 herolib_* deps in hero_lib_rhai/Cargo.toml to the merge point of the deleted development_casper branch (commit ab985c9) so v0.1.0-rc2 could ship CI binaries — see lhumina_code/hero_lib_rhai#15. The rev-pin gets lifted when the modernization in #16 lands.

Updated offender list (relative to the META as of today):

Adding another offender surfaced during session 65 of the home#212 build-binaries arc: - **`hero_lib_rhai/crates/ai_rhai`** — Rhai bindings that wrap `herolib_ai`. Bound to the pre-rewrite client API; 39 `cargo check` errors against current `hero_lib` development. Filed: https://forge.ourworld.tf/lhumina_code/hero_lib_rhai/issues/16 Worked around in session 65 by rev-pinning all 14 `herolib_*` deps in `hero_lib_rhai/Cargo.toml` to the merge point of the deleted `development_casper` branch (commit `ab985c9`) so v0.1.0-rc2 could ship CI binaries — see https://forge.ourworld.tf/lhumina_code/hero_lib_rhai/pulls/15. The rev-pin gets lifted when the modernization in #16 lands. Updated offender list (relative to the META as of today): - [hero_biz#15](https://forge.ourworld.tf/lhumina_code/hero_biz/issues/15) - [hero_lib_rhai#16](https://forge.ourworld.tf/lhumina_code/hero_lib_rhai/issues/16) ← new
Owner

Direction update — single-SDK consolidation (cc @timur)

The active direction has shifted since this META was filed. Per hero_aibroker#63 (filed 2026-05-08), the plan is no longer "apps use hero_lib AI client" — it's "hero_aibroker_sdk becomes the only Rust AI client; herolib_ai is retired".

Why: two parallel clients (herolib_ai::AiClient::from_env() reads provider env vars directly; hero_aibroker_sdk::HeroAibrokerClient talks to the broker over UDS) drift apart on model catalogs, cost tracking, and provider auth. We just hit this in hero_books (broker had keys in ~/hero/var/hero_aibroker/.env, herolib_ai read process env → assistant dies with "model not available").

Status against the original acceptance criteria

  • Broker SDK has surface parity with herolib_ai as of #64 + #70. PromptBuilder, model constants, connect_default(), migration recipes all in the SDK.
  • 🔄 App migration audit — 27 files across 10 repos identified in #63's comment. hero_researcher (15) is the heaviest user. Migration starts with hero_books (3 files, has refactor branch already).
  • 🟡 aibroker downloads models everywhere#62 still open; unchanged.
  • 🟡 Provider fallback chain#55 still open; unchanged.

Updated acceptance

  • No app in lhumina_code/* depends on herolib_ai (was: "instantiates a non-hero_lib LLM client")
  • herolib_ai crate is removed from hero_lib
  • Every voice surface uses the broker SDK (canonical voice skill still applies)
  • aibroker's fallback chain is live (#55)
  • hero_lib CI is green (hero_lib#134)

The work itself is largely the same — apps still consume LLM/voice through one Rust client that talks to the broker. The crate name changes from herolib_ai to hero_aibroker_sdk, and herolib_ai retires rather than evolving.

### Direction update — single-SDK consolidation (cc @timur) The active direction has shifted since this META was filed. Per [hero_aibroker#63](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/63) (filed 2026-05-08), the plan is no longer "apps use `hero_lib` AI client" — it's **"`hero_aibroker_sdk` becomes the only Rust AI client; `herolib_ai` is retired"**. Why: two parallel clients (`herolib_ai::AiClient::from_env()` reads provider env vars directly; `hero_aibroker_sdk::HeroAibrokerClient` talks to the broker over UDS) drift apart on model catalogs, cost tracking, and provider auth. We just hit this in `hero_books` (broker had keys in `~/hero/var/hero_aibroker/.env`, `herolib_ai` read process env → assistant dies with "model not available"). #### Status against the original acceptance criteria - ✅ **Broker SDK has surface parity with `herolib_ai`** as of [#64](https://forge.ourworld.tf/lhumina_code/hero_aibroker/pulls/64) + [#70](https://forge.ourworld.tf/lhumina_code/hero_aibroker/pulls/70). `PromptBuilder`, model constants, `connect_default()`, migration recipes all in the SDK. - 🔄 **App migration audit** — 27 files across 10 repos identified in [#63's comment](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/63#issuecomment-31034). `hero_researcher` (15) is the heaviest user. Migration starts with `hero_books` (3 files, has refactor branch already). - 🟡 **aibroker downloads models everywhere** — [#62](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/62) still open; unchanged. - 🟡 **Provider fallback chain** — [#55](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/55) still open; unchanged. #### Updated acceptance - [ ] No app in `lhumina_code/*` depends on `herolib_ai` (was: "instantiates a non-hero_lib LLM client") - [ ] `herolib_ai` crate is removed from `hero_lib` - [ ] Every voice surface uses the broker SDK (canonical voice skill still applies) - [ ] aibroker's fallback chain is live ([#55](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/55)) - [ ] hero_lib CI is green ([hero_lib#134](https://forge.ourworld.tf/lhumina_code/hero_lib/issues/134)) The work itself is largely the same — apps still consume LLM/voice through one Rust client that talks to the broker. The crate name changes from `herolib_ai` to `hero_aibroker_sdk`, and `herolib_ai` retires rather than evolving.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
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
lhumina_code/home#219
No description provided.