mirror of
https://github.com/hanzoai/engine.git
synced 2026-11-20 23:45:50 +00:00
The hanzoai/ai cloud-api router.Client posts to {endpoint}/route with
{prompt, tasks?, slo?} and decodes {model, task, confidence, features?}.
Add classify_handler on that path (distinct from the /v1/route placement
surface): classify the prompt via hanzo-router's Heuristic, pick a
servable model from the engine's loaded pool honoring slo.max_cost, and
return a stable 16-dim feature vector from the enso HashFeaturizer seam
for offline router training (feature values only, never prompt text).
Works on the pure-Rust path with no zen-router model loaded: it returns
the task + features and an empty model id, which the caller maps via its
own policy table. Pure decision measured at 3.7us/call over 20k iters,
far inside the client's 150ms budget.
Co-authored-by: Hanzo Dev <[email protected]>
71 lines
2.1 KiB
TOML
71 lines
2.1 KiB
TOML
[package]
|
|
name = "hanzo-server-core"
|
|
readme = "../README.md"
|
|
authors = ["Hanzo AI"]
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
description.workspace = true
|
|
repository.workspace = true
|
|
keywords.workspace = true
|
|
categories.workspace = true
|
|
license.workspace = true
|
|
homepage.workspace = true
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
axum = { workspace = true, features = ["tokio", "multipart"] }
|
|
hanzo-ml.workspace = true
|
|
hanzo-router = { version = "0.1", path = "../hanzo-router" }
|
|
enso = { version = "0.1", path = "../enso" }
|
|
hanzo-3d = "0.1"
|
|
data-url.workspace = true
|
|
either.workspace = true
|
|
futures.workspace = true
|
|
image.workspace = true
|
|
indexmap.workspace = true
|
|
itertools.workspace = true
|
|
base64.workspace = true
|
|
hanzo-engine = { workspace = true, features = [
|
|
"utoipa",
|
|
] }
|
|
hanzo-train = { workspace = true, features = ["utoipa"] }
|
|
dirs.workspace = true
|
|
reqwest.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
tokio.workspace = true
|
|
tower-http = { workspace = true, features = ["cors"] }
|
|
tracing.workspace = true
|
|
url.workspace = true
|
|
utoipa = { workspace = true, features = ["axum_extras"] }
|
|
utoipa-swagger-ui = { workspace = true, features = ["axum"], optional = true }
|
|
uuid = { workspace = true, features = ["v4"] }
|
|
|
|
accelerate-src = { workspace = true, optional = true }
|
|
intel-mkl-src = { workspace = true, optional = true }
|
|
|
|
[dev-dependencies]
|
|
tempfile.workspace = true
|
|
|
|
[features]
|
|
default = ["swagger-ui"]
|
|
swagger-ui = ["dep:utoipa-swagger-ui"]
|
|
cuda = ["hanzo-engine/cuda"]
|
|
vulkan = ["hanzo-engine/vulkan"]
|
|
wgpu = ["hanzo-engine/wgpu"]
|
|
rocm = ["hanzo-engine/rocm"]
|
|
cudnn = ["hanzo-engine/cudnn"]
|
|
metal = ["hanzo-engine/metal"]
|
|
flash-attn = ["cuda", "hanzo-engine/flash-attn"]
|
|
flash-attn-v3 = ["cuda", "hanzo-engine/flash-attn-v3"]
|
|
accelerate = ["hanzo-engine/accelerate"]
|
|
mkl = ["hanzo-engine/mkl"]
|
|
nccl = ["hanzo-engine/nccl"]
|
|
ring = ["hanzo-engine/ring"]
|
|
code-execution = ["hanzo-engine/code-execution"]
|
|
license-enforce = ["hanzo-engine/license-enforce"]
|
|
license-app-hanzo = ["hanzo-engine/license-app-hanzo"]
|
|
license-app-lux = ["hanzo-engine/license-app-lux"]
|
|
license-app-zoo = ["hanzo-engine/license-app-zoo"]
|