The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(inference): remove tier-related logic from factory
Steven Enamakelc16ddd695afe
diff --git a/crates/openhuman-core/src/inference/provider/factory.rs b/crates/openhuman-core/src/inference/provider/factory.rsindex eca287b709..a7082e5b71 100644--- a/crates/openhuman-core/src/inference/provider/factory.rs+++ b/crates/openhuman-core/src/inference/provider/factory.rs@@ -48,7 +48,6 @@ mod local_runtime;mod managed_backend;mod routing;mod subprocess_providers;-mod tiers;mod turn_model;#[cfg(feature = "flows")]@@ -65,10 +64,6 @@ pub(crate) use local_runtime::create_local_chat_model_from_string;pub(crate) use managed_backend::make_openhuman_backend_model;pub(crate) use routing::role_uses_implicit_cloud_fallback;pub use routing::{provider_for_role, role_bypasses_managed_credits};-pub(crate) use tiers::{- is_known_openhuman_tier, is_raw_passthrough_model, oh_tier_supports_vision,-};-pub use tiers::{resolve_model_for_hint, role_for_model_tier};pub(crate) use turn_model::{create_turn_chat_model, create_turn_chat_model_from_string,create_turn_chat_model_from_string_with_native_tools_and_route,@@ -91,13 +86,12 @@ use local_runtime::{pub(crate) use managed_backend::{make_openhuman_backend_model_for_options, make_openhuman_backend_model_for_thread,};-use managed_backend::{managed_chat_model, resolve_managed_model};+use managed_backend::managed_chat_model;use subprocess_providers::{prepare_claude_agent_sdk_chat_model, try_create_claude_agent_sdk_chat_model,try_create_claude_agent_sdk_chat_model_from_string, try_create_claude_code_chat_model,try_create_claude_code_chat_model_from_string,};-use tiers::{is_abstract_tier_model, managed_default_model};use tinyinference_providers::route::split_model_and_temperature;/// Test-only seam: inject a mock [`ChatModel`] so e2e tests can drive thediff --git a/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs b/crates/openhuman-core/src/inference/provider/factory/managed_backend.rsindex 268b1ebb28..9c5b0a05e1 100644--- a/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs+++ b/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs@@ -13,49 +13,6 @@ type ManagedChatModel = (String,);-/// The concrete model id a managed route runs on: the pinned default (else-/// `MODEL_MANAGED_DEFAULT`), unless `model_override` names something.-///-/// An override that is itself a managed alias (`hint:coding`, `hint:chat`)-/// means "this role on the managed backend": the default model. A concrete id-/// (`openrouter/deepseek/deepseek-v4-pro`) is forwarded verbatim; the backend-/// is authoritative over its validity (issue #4598).-pub(super) fn resolve_managed_model(- role: &str,- config: &Config,- model_override: Option<&str>,-) -> String {- // Every managed role runs on one concrete model: the pinned default, else- // `MODEL_MANAGED_DEFAULT`. Roles still matter (they picked the *route* that- // led here) but there are no per-role tier endpoints any more.- let model = managed_default_model(config);- log::debug!(- "[providers][chat-factory] role={} managed resolves to model={}",- role,- model- );- match model_override.map(str::trim).filter(|m| !m.is_empty()) {- Some(raw) if is_known_openhuman_tier(raw) => {- log::debug!(- "[providers][chat-factory] role={} override '{}' is a managed alias; using model={}",- role,- raw,- model- );- model- }- Some(raw) => {- log::debug!(- "[providers][chat-factory] role={} forwarding pinned model '{}' verbatim to the managed backend",- role,- raw- );- raw.to_string()- }- None => model,- }-}-/// The error the managed provider answers with when no chat-model provider is/// registered for it.pub(crate) fn managed_unavailable_error() -> anyhow::Error {@@ -84,7 +41,13 @@ pub(super) fn managed_chat_model(log::debug!("[providers][chat-factory] role={role} managed provider is not registered");return Err(managed_unavailable_error());};- let model = resolve_managed_model(role, config, model_override);+ let model = crate::inference::registry::resolve_provider_model(+ PROVIDER_OPENHUMAN,+ role,+ config,+ model_override,+ )+ .ok_or_else(managed_unavailable_error)?;log::debug!("[providers][chat-factory] role={role} managed provider served by a registered chat model model={model}");