Skip to content

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

feat(inference): add openhuman backend model calls

Steven Enamakel43997325b6db
diff --git a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_calls.rs b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_calls.rs
index 1710e26fc7..b52aa4245b 100644
--- a/crates/openhuman-core/src/inference/provider/openhuman_backend_model_calls.rs
+++ b/crates/openhuman-core/src/inference/provider/openhuman_backend_model_calls.rs
@@ -68,13 +68,10 @@ impl ChatModel<()> for OpenHumanBackendModel {
request: ModelRequest,
) -> tinyinference_llm::Result<ModelStream> {
let model = self.build_wire_model()?;
- // NOTE (streaming billing parity): the crate SSE parser sets `raw: None`
- // on the terminal `Completed` response, so the `openhuman.billing` envelope
- // is not available to `project_managed_usage` here — a streaming managed
- // turn's charged USD falls back to the catalog cost estimate (token counts
- // survive via `UsageDelta`). The authoritative charged amount is recovered
- // on the non-streaming `invoke` path above. Restoring it for streaming
- // needs the crate to preserve the final chunk's raw JSON (tracked upstream).
+ // The backend sends its charge on an `openhuman-metadata` frame before
+ // `[DONE]`; the crate's SSE parser keeps that envelope on the terminal
+ // response's `raw`, so the streamed `Completed` is projected exactly like
+ // the `invoke` path above and carries the charged USD.
match model
.stream(
state,