diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index 4c506284..81c1bdf9 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -88,11 +88,11 @@ enum Cmd { /// Keys are matched case-insensitively as a substring of the /// model id; models not covered fall back to the built-in /// estimate. Set via the `services.hyperhive.modelPrices` NixOS - /// option. - #[arg( - long, - default_value = r#"{"opus":{"input":15.0,"output":75.0,"cache_read":1.5,"cache_write":18.75},"sonnet":{"input":3.0,"output":15.0,"cache_read":0.3,"cache_write":3.75},"haiku":{"input":0.8,"output":4.0,"cache_read":0.08,"cache_write":1.0}}"# - )] + /// option (whose default carries the full opus/sonnet/haiku + /// table). Defaults to `{}` here so a bare `hive-c0re serve` + /// leans entirely on the in-code `builtin_prices` fallback — + /// keeping a single source of truth for the numbers. + #[arg(long, default_value = "{}")] model_prices: String, }, /// Spawn a new agent container directly (`hive-agent-`). Bypasses diff --git a/nix/modules/hive-c0re.nix b/nix/modules/hive-c0re.nix index 4ef9e2dd..9b0d7b1f 100644 --- a/nix/modules/hive-c0re.nix +++ b/nix/modules/hive-c0re.nix @@ -428,19 +428,19 @@ in lib.types.submodule { options = { input = lib.mkOption { - type = lib.types.float; + type = lib.types.numbers.nonnegative; description = "USD per million input tokens."; }; output = lib.mkOption { - type = lib.types.float; + type = lib.types.numbers.nonnegative; description = "USD per million output tokens."; }; cache_read = lib.mkOption { - type = lib.types.float; + type = lib.types.numbers.nonnegative; description = "USD per million cache-read tokens."; }; cache_write = lib.mkOption { - type = lib.types.float; + type = lib.types.numbers.nonnegative; description = "USD per million cache-creation (write) tokens."; }; };