Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(inference): rename managed backend model references to TinyHumansModel

Steven Enamakel153aec16c38d
diff --git a/crates/openhuman-core/src/agent/session_host/builder/setters.rs b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
index 448e2cb9ef..5d30c79cc8 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
@@ -72,7 +72,7 @@ impl SessionHostBuilder {
/// Sets the AI provider as a **crate-native** turn-model source (Phase 3 P3-B):
/// `build`/`build_summarizer` construct crate `ChatModel`s from `(role, config)`
- /// via `create_turn_chat_model` (managed → `OpenHumanBackendModel`, local/cloud →
+ /// via `create_turn_chat_model` (managed → `TinyHumansModel`, local/cloud →
/// crate `OpenAiModel`) instead of wrapping `provider` in `native model adapters.
/// Used by the production session factory; the plain
/// [`provider`](Self::provider) setter (Provider path) stays for tests that
diff --git a/crates/openhuman-core/src/inference/README.md b/crates/openhuman-core/src/inference/README.md
index 8a2f0552b9..bc8b402471 100644
--- a/crates/openhuman-core/src/inference/README.md
+++ b/crates/openhuman-core/src/inference/README.md
@@ -79,13 +79,12 @@ through the same gates and constructors.
### The managed backend model
-The managed backend model (`crates/openhuman-tinyhumans/src/inference/managed_model.rs`, registered with `inference::registry` under `PROVIDER_OPENHUMAN`) is a host `ChatModel` for the OpenHuman backend. It cannot be
-a plain `tinyinference` OpenAI preset for three reasons: the session bearer is resolved fresh per
-call, the request carries a top-level `thread_id` so the backend can group logs and align cache
-keys, and the response carries an `openhuman.{billing,usage}` envelope with the charged USD that
-the generic parser drops. The model re-projects that envelope
-(`managed_usage.rs` in `openhuman-tinyhumans`) so usage meters see real costs. When the bearer's `exp` has
-already passed, or the backend rejects it, it publishes `DomainEvent::SessionExpired`.
+Managed chat uses TinyInference's `TinyHumansModel` through the host adapter in
+`openhuman-tinyhumans/src/inference/managed_model.rs`. The adapter supplies the live bearer
+resolver and host error observer; TinyInference owns request construction and response parsing.
+The host's typed authentication-failure callback publishes `DomainEvent::SessionExpired` when a
+stored session has expired or the backend rejects it. API-key credentials remain eligible for
+managed inference and do not trigger session demotion.
[`provider/openai_codex.rs`](./provider/openai_codex.rs) is related but is not a model. When ChatGPT/Codex OAuth tokens exist
for the `openai` slug, `resolve_openai_codex_routing` re-targets that slug at the Codex backend
@@ -221,7 +220,7 @@ picks the provider the same way a provider string does.
- `probe_inference_readiness` (`provider/factory/chat_model.rs`) checks that a role can actually
run: it builds the model and, for the managed backend, makes one cheap completion.
- `BYOK_INCOMPLETE_SENTINEL` (`provider/factory.rs`) marks a BYOK route with missing pieces.
-- `OpenHumanBackendModel` (`openhuman-tinyhumans`, `src/inference/managed_model.rs`) is the managed backend model, registered through `registry.rs`.
+- `TinyHumansModel` (from TinyInference) is the managed chat implementation; `openhuman-tinyhumans/src/inference/managed_model.rs` supplies host credential and failure policy, and `registry.rs` registers it under `PROVIDER_OPENHUMAN`.
- `host_runtime::global` ([`host_runtime/core.rs`](./host_runtime/core.rs)) returns the `LocalAiService` singleton.
- `agent_chat_for` and `agent_chat_reply_for` (`agent_runs/agent_chat/session_turn.rs`) run an agent turn
natively. `INFERENCE_AGENT_CHAT` (`agent_runs::INFERENCE_AGENT_CHAT`) is the wire method name hosts reference.
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index 334ed0e845..0a37972aee 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -241,7 +241,7 @@ async fn one_shot_chat_models_preserve_factory_temperature_as_request_default()
// ── Motion B (#4727): managed-backend crate-native routing ──────────────────
// `create_chat_model` must route the managed OpenHuman backend through the
-// crate-native `OpenHumanBackendModel`, whose concrete `managed` profile
+// crate-native `TinyHumansModel`, whose concrete `managed` profile
// advertises the capabilities that routing previously inferred through the
// provider adapter.
diff --git a/crates/openhuman-core/src/inference/turn_models.rs b/crates/openhuman-core/src/inference/turn_models.rs
index 081773f790..3a357db070 100644
--- a/crates/openhuman-core/src/inference/turn_models.rs
+++ b/crates/openhuman-core/src/inference/turn_models.rs
@@ -97,7 +97,7 @@ impl TurnModels {
/// the Phase 3 P3-B cutover of [`build_turn_models`]: instead of wrapping one host
/// `Provider` per tier in a [`native model adapter`], each tier is built as a crate-native
/// [`ChatModel`] via [`factory::create_turn_chat_model`] (managed →
-/// `OpenHumanBackendModel`, local/cloud → crate `OpenAiModel`).
+/// `TinyHumansModel`, local/cloud → crate `OpenAiModel`).
///
/// The `TurnModels` shape is identical to [`build_turn_models`] so
/// [`OpenHumanTurnPlanner`](crate::agent::tinyagents::turn_plan::OpenHumanTurnPlanner) is unchanged. The provider metadata
diff --git a/crates/openhuman-core/src/platform/llm_gate/gate.rs b/crates/openhuman-core/src/platform/llm_gate/gate.rs
index d20a5383f2..73a55654d6 100644
--- a/crates/openhuman-core/src/platform/llm_gate/gate.rs
+++ b/crates/openhuman-core/src/platform/llm_gate/gate.rs
@@ -185,7 +185,7 @@ pub fn current_policy() -> Policy {
/// `true` when the signed-out override is active. Cheap atomic load —
/// safe to call from hot paths (e.g. per-LLM-call short-circuit in
-/// `OpenHumanBackendModel`).
+/// `TinyHumansModel` through its host adapter).
///
/// Always `false` in SaaS mode: there, signed in is a fact about each user,
/// checked against that user's own credential when it is used, and one
diff --git a/crates/openhuman-core/src/security/credentials/api_key.rs b/crates/openhuman-core/src/security/credentials/api_key.rs
index 9313064c34..d758a0d1df 100644
--- a/crates/openhuman-core/src/security/credentials/api_key.rs
+++ b/crates/openhuman-core/src/security/credentials/api_key.rs
@@ -7,8 +7,8 @@
//!
//! * managed inference (`{api_url}` + the inference path) sends it as
//! `Authorization: Bearer <key>` — the OpenAI-compatible endpoint takes a
-//! bearer, and `OpenHumanBackendModel::resolve_bearer` prefers this profile
-//! over the app session;
+//! bearer, and the managed-inference host resolver prefers this profile over
+//! the app session;
//! * SDK REST clients send it as `x-api-key` — `BackendClient` and
//! `IntegrationClient` pick the header from [`BackendCredential`];
//! * bearer-only callers (cloud STT and embeddings, the connector proxy
diff --git a/crates/openhuman-core/src/security/credentials/session_support.rs b/crates/openhuman-core/src/security/credentials/session_support.rs
index de1feeca41..2ba009e201 100644
--- a/crates/openhuman-core/src/security/credentials/session_support.rs
+++ b/crates/openhuman-core/src/security/credentials/session_support.rs
@@ -418,8 +418,8 @@ impl BackendCredential {
pub const LOCAL_SESSION_BACKEND_UNAVAILABLE: &str =
"BACKEND_UNAVAILABLE: hosted account data is unavailable for the offline local session";
-/// Error [`OpenHumanBackendModel::resolve_bearer`](crate::inference::provider::OpenHumanBackendModel)
-/// returns for the offline local session. The local credential authenticates
+/// Error returned by the TinyHumans managed-inference host resolver for the
+/// offline local session. The local credential authenticates
/// no TinyHumans account, so managed inference has nothing to bill or route;
/// sending the token anyway earned a backend `401` that read to the user as an
/// expired session (#6932). Distinct from
diff --git a/crates/openhuman-tinyhumans/src/client/backend_client_tests.rs b/crates/openhuman-tinyhumans/src/client/backend_client_tests.rs
index 063e135dbe..4e524c6658 100644
--- a/crates/openhuman-tinyhumans/src/client/backend_client_tests.rs
+++ b/crates/openhuman-tinyhumans/src/client/backend_client_tests.rs
@@ -85,7 +85,7 @@ async fn spawn_header_capture_server() -> (String, CapturedHeaders) {
async fn authed_json_sends_an_api_key_as_x_api_key_and_no_bearer() {
// Library mode: the TinyHumans API key rides the SDK REST routes as
// `x-api-key`, never as `Authorization: Bearer` (that header is the
- // managed-inference shape, handled by `OpenHumanBackendModel`).
+ // managed-inference shape, handled by `TinyHumansModel` through the host adapter).
use openhuman_embed::__host::security::credentials::session_support::BackendCredential;
let (base_url, captured) = spawn_header_capture_server().await;