review: address damocles nits on modelPrices

- modelPrices submodule fields use lib.types.numbers.nonnegative
  instead of lib.types.float: accepts bare ints (15) as well as floats
  (15.0) and rejects negative prices for free.
- Collapse the triple-sourced default: hive-c0re serve --model-prices
  now defaults to "{}" so builtin_prices() is the single in-code
  fallback. The nix option default still carries the full
  opus/sonnet/haiku table to self-document prices for operators.
This commit is contained in:
iris 2026-06-05 23:55:33 +02:00
commit 60caef73f9
2 changed files with 9 additions and 9 deletions

View file

@ -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.";
};
};