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): drop shared chat model adapter
Steven Enamakel0cce0350e2ed
diff --git a/crates/openhuman-core/src/inference/http/backend.rs b/crates/openhuman-core/src/inference/http/backend.rsindex 1ccfa9110a..315a426f9e 100644--- a/crates/openhuman-core/src/inference/http/backend.rs+++ b/crates/openhuman-core/src/inference/http/backend.rs@@ -12,10 +12,6 @@//! - `"openhuman"` -> OpenHuman backend (session JWT)use async_trait::async_trait;-use tinyinference_llm::model::{- ChatModel, DeferredHandle, DeferredStatus, InputModality, InputSource, ModelProfile,- ModelRequest, ModelResponse, ModelStream,-};use tinyinference_llm::providers::openai::server_http::{strip_temperature_suffix, BackendFailure, ChatBackend, ListedModel, ResolvedChat,};@@ -28,52 +24,6 @@ const LOG_PREFIX: &str = "[inference::http]";/// Resolves `/v1` requests against the loaded OpenHuman [`Config`].pub(super) struct HostChatBackend;-/// Adapts the factory's shared `Arc<dyn ChatModel>` to the owned box the pinned-/// `ResolvedChat` takes. tinyinference#98 makes `ResolvedChat` hold an `Arc`;-/// delete this wrapper once the tinyagents pin carries that commit. That bump-/// also removes the file turn-state store (tinyagents#430), whose host-/// migration (`TurnStates` port) belongs to the tinyagents epic, so the pin-/// has not moved here.-struct SharedChatModel(std::sync::Arc<dyn ChatModel<()>>);--#[async_trait]-impl ChatModel<()> for SharedChatModel {- fn profile(&self) -> Option<&ModelProfile> {- self.0.profile()- }- fn supports_input(- &self,- modality: InputModality,- mime_type: &str,- source: InputSource,- ) -> bool {- self.0.supports_input(modality, mime_type, source)- }- fn cache_identity(&self) -> Option<String> {- self.0.cache_identity()- }- async fn invoke(- &self,- state: &(),- request: ModelRequest,- ) -> tinyinference_llm::Result<ModelResponse> {- self.0.invoke(state, request).await- }- async fn stream(- &self,- state: &(),- request: ModelRequest,- ) -> tinyinference_llm::Result<ModelStream> {- self.0.stream(state, request).await- }- async fn fetch_deferred(- &self,- handle: &DeferredHandle,- ) -> tinyinference_llm::Result<DeferredStatus> {- self.0.fetch_deferred(handle).await- }-}-/// Bare model names (no `:`, not the `openhuman` sentinel) are local Ollama models.pub(super) fn provider_string_for(model: &str) -> String {if model.contains(':') || model == "openhuman" {@@ -124,7 +74,7 @@ impl ChatBackend for HostChatBackend {);}Ok(ResolvedChat {- chat_model: Box::new(SharedChatModel(chat_model)),+ chat_model: chat_model,model_id,temperature: raw,})