From 508fb12e9f89f3f5963292f8a83256f5f6b8411e Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 16:20:58 +0300 Subject: [PATCH 1/6] refactor: consume tinyinference core crate Co-authored-by: Medulla --- Cargo.lock | 10 +++++++--- Cargo.toml | 2 +- examples/persona_agent.rs | 8 ++++---- src/memory/chunks/signature.rs | 4 ++-- src/memory/health.rs | 2 +- src/memory/health_tests.rs | 2 +- src/memory/store/vectors/embedding.rs | 14 +++++++------- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 446d3b2..a32ba07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1703,7 +1703,7 @@ dependencies = [ "tempfile", "thiserror", "tinycortex-api", - "tinyinference", + "tinyinference-core", "tokio", "toml", "tracing", @@ -1720,13 +1720,15 @@ 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=98f402a#98f402afa426bbca8360c8e2dc68ca543421e1f2" dependencies = [ + "anyhow", "async-trait", "bytes", "futures", + "hex", "httpdate", "reqwest", "serde", @@ -1734,6 +1736,8 @@ dependencies = [ "sha2 0.11.0", "thiserror", "tokio", + "tracing", + "url", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 08801e0..8f51a13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ 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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "98f402a" } # 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..6a78667 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-core`] 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_core::message::Message; +use tinyinference_core::model::{ChatModel, ModelRequest}; +use tinyinference_core::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..e13fba9 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-core`), 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_core::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..e6570a6 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_core::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..2425975 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_core::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..408ee95 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_core::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_core::embeddings::EmbeddingModel + ?Sized, { fn name(&self) -> &str { - tinyinference::embeddings::EmbeddingModel::name(self) + tinyinference_core::embeddings::EmbeddingModel::name(self) } fn model_id(&self) -> &str { - tinyinference::embeddings::EmbeddingModel::model_id(self) + tinyinference_core::embeddings::EmbeddingModel::model_id(self) } fn dimensions(&self) -> usize { - tinyinference::embeddings::EmbeddingModel::dimensions(self) + tinyinference_core::embeddings::EmbeddingModel::dimensions(self) } fn signature(&self) -> String { - tinyinference::embeddings::EmbeddingModel::signature(self) + tinyinference_core::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_core::embeddings::EmbeddingModel::embed(self, &owned) .await .map_err(|error| anyhow::anyhow!(error)) } From a225ba3ab5ae8154cb3d42a4eadac54af7d54bf3 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 16:31:49 +0300 Subject: [PATCH 2/6] chore: update tinyinference split Co-authored-by: Medulla --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a32ba07..587f155 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=98f402a#98f402afa426bbca8360c8e2dc68ca543421e1f2" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=6428931#6428931d2fb259e4135f3b4a0e96b29d97c92c7e" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 8f51a13..08f808a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ 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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "98f402a" } +tinyinference-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "6428931" } # 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. From 7e6b6622594f2aad73ad611f1d92ee10340cb16c Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 16:39:52 +0300 Subject: [PATCH 3/6] chore: update tinyinference review fixes Co-authored-by: Medulla --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 587f155..3330652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=6428931#6428931d2fb259e4135f3b4a0e96b29d97c92c7e" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=6f4f849#6f4f8497afd14e01492afb20bd491cec44e6602f" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 08f808a..0913959 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ 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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "6428931" } +tinyinference-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "6f4f849" } # 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. From 0969d86d40115ec503abf21a25b3309d153558b6 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 16:55:14 +0300 Subject: [PATCH 4/6] chore: update tinyinference test fix Co-authored-by: Medulla --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3330652..32458cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=6f4f849#6f4f8497afd14e01492afb20bd491cec44e6602f" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=aaeb60b#aaeb60ba841a9ce896b4f4617fb5936006b7ac95" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 0913959..75959c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ 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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "6f4f849" } +tinyinference-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "aaeb60b" } # 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. From 9a8167f9dcc48ad82a509c2cbf111f01c85b1b4c Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 16:59:33 +0300 Subject: [PATCH 5/6] chore: update tinyinference policy boundary Co-authored-by: Medulla --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32458cb..ede91c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=aaeb60b#aaeb60ba841a9ce896b4f4617fb5936006b7ac95" +source = "git+https://github.com/tinyhumansai/tinyinference?rev=792028b#792028b6be2515ab4967ffa57e663eaa52b018e9" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 75959c2..4ebae99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,7 +121,7 @@ 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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "aaeb60b" } +tinyinference-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "792028b" } # 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. From 1ce634005c3f9315bf8e2b1faf0ea3f5404d356a Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 18 Sep 2026 17:35:19 +0300 Subject: [PATCH 6/6] refactor: use focused inference crates Co-authored-by: Medulla --- Cargo.lock | 33 +++++++++++++++++++++++---- Cargo.toml | 3 ++- examples/persona_agent.rs | 8 +++---- src/memory/chunks/signature.rs | 4 ++-- src/memory/health.rs | 2 +- src/memory/health_tests.rs | 2 +- src/memory/store/vectors/embedding.rs | 14 ++++++------ 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ede91c6..1f81cee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1703,7 +1703,8 @@ dependencies = [ "tempfile", "thiserror", "tinycortex-api", - "tinyinference-core", + "tinyinference-embeddings", + "tinyinference-llm", "tokio", "toml", "tracing", @@ -1722,19 +1723,43 @@ dependencies = [ [[package]] name = "tinyinference-core" version = "0.2.1" -source = "git+https://github.com/tinyhumansai/tinyinference?rev=792028b#792028b6be2515ab4967ffa57e663eaa52b018e9" +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", - "hex", - "httpdate", "reqwest", "serde", "serde_json", "sha2 0.11.0", "thiserror", + "tinyinference-core", "tokio", "tracing", "url", diff --git a/Cargo.toml b/Cargo.toml index 4ebae99..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-core = { git = "https://github.com/tinyhumansai/tinyinference", rev = "792028b" } +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 6a78667..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-core`] 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_core::message::Message; -use tinyinference_core::model::{ChatModel, ModelRequest}; -use tinyinference_core::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 e13fba9..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-core`), 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_core::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 e6570a6..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_core::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 2425975..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_core::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 408ee95..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_core::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_core::embeddings::EmbeddingModel + ?Sized, + T: tinyinference_embeddings::EmbeddingModel + ?Sized, { fn name(&self) -> &str { - tinyinference_core::embeddings::EmbeddingModel::name(self) + tinyinference_embeddings::EmbeddingModel::name(self) } fn model_id(&self) -> &str { - tinyinference_core::embeddings::EmbeddingModel::model_id(self) + tinyinference_embeddings::EmbeddingModel::model_id(self) } fn dimensions(&self) -> usize { - tinyinference_core::embeddings::EmbeddingModel::dimensions(self) + tinyinference_embeddings::EmbeddingModel::dimensions(self) } fn signature(&self) -> String { - tinyinference_core::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_core::embeddings::EmbeddingModel::embed(self, &owned) + tinyinference_embeddings::EmbeddingModel::embed(self, &owned) .await .map_err(|error| anyhow::anyhow!(error)) }