[arch] hero_aibroker has zero per-context awareness — billing/rate-limit global per-IP #54
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_aibroker#54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_aibrokerhas zero per-context awareness.X-Hero-Contextis not honoured anywhere in the broker; billing and rate-limiting are bucketed globally per source-IP rather than per(ip, context). For multi-tenant deployments this means LLM spend, rate limits, and quotas leak across contexts at the broker layer.What the code does today
openai,openrouter,groq,sambanova,alibaba) share oneOpenAIProviderstruct with different base URLs.autowithROUTING_STRATEGY=cheapest.X-Hero-Contextheader is not parsed or threaded through any handler.rpc.sock(admin),rest.sock(OpenAI-compatible v1),web_v1.sockproxy variant. Plushero_aibroker_ui/ui.sock.Why this matters
Sovereignty + multi-tenancy is a load-bearing property of the Hero stack (hero_demo#52 vision). Context isolation needs to hold at every layer the user's data or actions cross. LLM calls cross the broker on every chat / tool invocation. Today, a high-spend context can starve other contexts because they share the per-IP rate bucket.
Proposed fix
X-Hero-Contextat the REST/RPC entry handlers inhero_aibroker_server.(ip, context)rather thanipalone.rpc.sockadmin methods).Severity
Design-level. Not a security boundary today (no isolation is claimed at the broker layer), but contradicts the sovereignty story the demo pitch leans on.
Cross-refs
hero_embedder: discardsX-Hero-Context(separate issue)hero_indexer(separate issue)Spotted during docs_hero Phase 1 source-grounded read (session 52). Reconciliation memo:
memory/investigation_roadmap_reconciliation.md.#54
I reworked the broker quite well
now dynamic models
about billing I believe it should be per hero-os
so source ipv6 ip address is ok
this means who hosts hero-os pays
for now prob good enough
because otherwise will add lots of complications