diff --git a/Cargo.lock b/Cargo.lock index 446d3b2..1f81cee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1703,7 +1703,8 @@ dependencies = [ "tempfile", "thiserror", "tinycortex-api", - "tinyinference", + "tinyinference-embeddings", + "tinyinference-llm", "tokio", "toml", "tracing", @@ -1720,20 +1721,48 @@ dependencies = [ ] [[package]] -name = "tinyinference" +name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=cc8aca484bb995fbab3b7358f0d72ab5056b587c#cc8aca484bb995fbab3b7358f0d72ab5056b587c" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=bb0f820#bb0f820a246874dff7fff2569d8679303d354fb0" +dependencies = [ + "anyhow", + "httpdate", + "url", +] + +[[package]] +name = "tinyinference-embeddings" +version = "0.2.1" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=bb0f820#bb0f820a246874dff7fff2569d8679303d354fb0" +dependencies = [ + "async-trait", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tinyinference-core", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "tinyinference-llm" +version = "0.2.1" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=bb0f820#bb0f820a246874dff7fff2569d8679303d354fb0" dependencies = [ "async-trait", "bytes", "futures", - "httpdate", "reqwest", "serde", "serde_json", "sha2 0.11.0", "thiserror", + "tinyinference-core", "tokio", + "tracing", + "url", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 08801e0..65ba486 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,8 @@ thiserror = "2" # published; embedding hosts may patch this exact git source so the host and # TinyCortex share one `EmbeddingModel` trait identity without pulling in an # agent runtime. -tinyinference = { git = "https://github.com/tinyhumansai/tinyinference", rev = "cc8aca484bb995fbab3b7358f0d72ab5056b587c" } +tinyinference-embeddings = { git = "https://github.com/tinyhumansai/tinyinference", rev = "bb0f820" } +tinyinference-llm = { git = "https://github.com/tinyhumansai/tinyinference", rev = "bb0f820" } # The stable contract crate (value types, error enum, `Memory` trait). Declared # as a path dependency, not a registry requirement, so embedding hosts resolve # it through this checkout without needing their own `[patch.crates-io]` entry. diff --git a/examples/persona_agent.rs b/examples/persona_agent.rs index 7ffbc2c..2d08c04 100644 --- a/examples/persona_agent.rs +++ b/examples/persona_agent.rs @@ -5,7 +5,7 @@ //! //! 1. [`PersonaRetriever`] ranks persisted observations with deterministic, //! network-free BM25 retrieval weighted by evidence tier. -//! 2. A provider-neutral [`tinyinference`] model receives only those ranked +//! 2. A provider-neutral [`tinyinference-llm`] model receives only those ranked //! observations and the person's explicit directives, then writes one //! evidence-cited decision. //! @@ -25,9 +25,9 @@ //! - `TINYCORTEX_LLM_MODEL` — model id (default `deepseek/deepseek-v4-flash`). //! - `PERSONA_IDENTITY` — identity label in the prompt (default `this developer`). -use tinyinference::message::Message; -use tinyinference::model::{ChatModel, ModelRequest}; -use tinyinference::providers::openai::OpenAiModel; +use tinyinference_llm::message::Message; +use tinyinference_llm::model::{ChatModel, ModelRequest}; +use tinyinference_llm::providers::openai::OpenAiModel; use tinycortex::memory::config::MemoryConfig; use tinycortex::memory::persona::compile::read_directives; diff --git a/src/memory/chunks/signature.rs b/src/memory/chunks/signature.rs index 0ad2a5b..c0072b3 100644 --- a/src/memory/chunks/signature.rs +++ b/src/memory/chunks/signature.rs @@ -22,10 +22,10 @@ /// /// Delegates to the same formatter the namespace store's embedding providers /// use ([`crate::memory::store::vectors::format_embedding_signature`], itself a -/// re-export from `tinyinference`), so the two stores cannot drift into +/// re-export from `tinyinference-embeddings`), so the two stores cannot drift into /// byte-different spellings of the same space again. pub fn format_signature(provider: &str, model: &str, dims: usize) -> String { - tinyinference::embeddings::format_embedding_signature(provider, model, dims) + tinyinference_embeddings::format_embedding_signature(provider, model, dims) } /// A signature decomposed into the parts that identify its vector space. diff --git a/src/memory/health.rs b/src/memory/health.rs index 823a165..de48ef5 100644 --- a/src/memory/health.rs +++ b/src/memory/health.rs @@ -221,7 +221,7 @@ pub fn classify_embed_error_str(msg: &str) -> PipelineFailure { // #5354 — the local Ollama runtime is not usable: the daemon is not // listening, or the configured embedding model was never pulled. Both are - // emitted by `tinyinference::embeddings::ollama` with the fix already + // emitted by `tinyinference_embeddings::ollama` with the fix already // in the text: // // "ollama embed request failed (is Ollama running at ?): …" diff --git a/src/memory/health_tests.rs b/src/memory/health_tests.rs index 884b14b..42cff35 100644 --- a/src/memory/health_tests.rs +++ b/src/memory/health_tests.rs @@ -266,7 +266,7 @@ fn classify_transport_error_is_transient() { } /// #5354 — the Ollama daemon is not listening. Verbatim wording from -/// `tinyinference::embeddings::OllamaEmbeddingModel` request path. +/// `tinyinference_embeddings::OllamaEmbeddingModel` request path. /// Note the parenthesised hint: `parse_http_status` reads the first `(`, so /// without an explicit match this fell through to `Transient` and the panel /// told the user to wait for a retry that can never start their daemon. diff --git a/src/memory/store/vectors/embedding.rs b/src/memory/store/vectors/embedding.rs index 052e447..96b2725 100644 --- a/src/memory/store/vectors/embedding.rs +++ b/src/memory/store/vectors/embedding.rs @@ -20,7 +20,7 @@ use async_trait::async_trait; /// instantiated backend. Drift between the two would silently split one /// embedding space into two. pub fn format_embedding_signature(name: &str, model_id: &str, dims: usize) -> String { - tinyinference::embeddings::format_embedding_signature(name, model_id, dims) + tinyinference_embeddings::format_embedding_signature(name, model_id, dims) } /// Interface for embedding backends that convert text into numerical vectors. @@ -63,22 +63,22 @@ pub trait EmbeddingBackend: Send + Sync { #[async_trait] impl EmbeddingBackend for T where - T: tinyinference::embeddings::EmbeddingModel + ?Sized, + T: tinyinference_embeddings::EmbeddingModel + ?Sized, { fn name(&self) -> &str { - tinyinference::embeddings::EmbeddingModel::name(self) + tinyinference_embeddings::EmbeddingModel::name(self) } fn model_id(&self) -> &str { - tinyinference::embeddings::EmbeddingModel::model_id(self) + tinyinference_embeddings::EmbeddingModel::model_id(self) } fn dimensions(&self) -> usize { - tinyinference::embeddings::EmbeddingModel::dimensions(self) + tinyinference_embeddings::EmbeddingModel::dimensions(self) } fn signature(&self) -> String { - tinyinference::embeddings::EmbeddingModel::signature(self) + tinyinference_embeddings::EmbeddingModel::signature(self) } async fn embed(&self, texts: &[&str]) -> anyhow::Result>> { @@ -86,7 +86,7 @@ where .iter() .map(|text| (*text).to_owned()) .collect::>(); - tinyinference::embeddings::EmbeddingModel::embed(self, &owned) + tinyinference_embeddings::EmbeddingModel::embed(self, &owned) .await .map_err(|error| anyhow::anyhow!(error)) }