Skip to content

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

docs(tokenjuice): expand README with wiring details and clarify tool naming

Steven Enamakeld700d3c28ccd
diff --git a/crates/openhuman-core/src/inference/tokenjuice/README.md b/crates/openhuman-core/src/inference/tokenjuice/README.md
index 31d7551a76..37efc9b953 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/README.md
+++ b/crates/openhuman-core/src/inference/tokenjuice/README.md
@@ -8,12 +8,12 @@ OpenHuman-owned files:
| Path | Role |
| --- | --- |
-| `mod.rs` | TinyBus calls, config installation, pass-through fallback, and savings wiring. |
-| `types.rs` | Dependency-free copy of the stable JSON wire contract. |
+| `mod.rs` | TinyBus calls (through `tinyjuice_bus::names::methods` constants), config installation, pass-through fallback, and savings wiring. |
+| `types.rs` | Re-export of the `tinyjuice-bus` contract (`tinyjuice_bus::types::{AgentTokenjuiceCompression, CompressOptions, CompressedOutput, CompressorKind, ContentHint, ContentKind}` and `tinyjuice_bus::wire::{CacheStats, CompactResponse, InstallRequest, RangeUnit, RetrieveRange}`) under the paths ~40 call sites in this crate already use. |
| `schemas.rs` | JSON-RPC controller schemas and handlers. |
| `config_patch.rs` | Partial update shape for the `[tokenjuice]` config block. |
-| `tools.rs` | OpenHuman agent tool implementation for `tokenjuice_retrieve`. |
-| `ml/` | Bridge from TinyJuice's optional ML callback into `runtime_python_server` Kompress. |
+| `tools.rs` | OpenHuman agent tool implementation for the retrieve tool (`RETRIEVE_TOOL_NAME = "tinyjuice_retrieve"`; `"tokenjuice_retrieve"` is a recognized recovery-tool alias, not the tool's registered name — see `RECOVERY_TOOL_NAMES`). |
+| `ml/` | Bridge from TinyJuice's optional ML callback into the shared `runtime::python_server` Kompress backend (ModernBERT token/sentence salience); opt-in via `config.tokenjuice.ml_compression_enabled` (default off), degrades gracefully when the flag is off or the runtime server is unavailable. |
| `savings.rs` | OpenHuman model-pricing attribution and persisted dashboard stats. |
TinyJuice-owned engine pieces:
@@ -30,3 +30,17 @@ TinyJuice-owned engine pieces:
Do not add the `tinyjuice` crate back to OpenHuman. Runtime services, settings
persistence, JSON-RPC, tools, pricing, and the optional ML callback stay here;
engine behavior stays behind the loadable module boundary.
+
+## Wiring
+
+- `mod.rs::proxy` loads the module via `crate::modules::ensure_loaded(config,
+ "tinyjuice")` and looks it up with `crate::modules::registry::find("tinyjuice")`
+ before calling through `crate::modules::host::runtime()`.
+- Controllers are registered from `crate::inference::tokenjuice::all_tokenjuice_registered_controllers()`,
+ called by `core/all.rs`.
+- `crate::tools::mod` re-exports `TokenjuiceRetrieveTool`; its registered tool
+ name is `RETRIEVE_TOOL_NAME` (`"tinyjuice_retrieve"`), not
+ `"tokenjuice_retrieve"` — confirm against `tools/ops.rs`'s tool-name table
+ before assuming otherwise.
+- Contract crate: `tinyjuice-bus` (`vendor/tinyjuice/crates/tinyjuice-bus`,
+ path dependency in `crates/openhuman-core/Cargo.toml`).