ZIm/crates/language_model/src
Richard Feldman 5405c2c2d3
Standardize on u64 for token counts (#32869)
Previously we were using a mix of `u32` and `usize`, e.g. `max_tokens:
usize, max_output_tokens: Option<u32>` in the same `struct`.

Although [tiktoken](https://github.com/openai/tiktoken) uses `usize`,
token counts should be consistent across targets (e.g. the same model
doesn't suddenly get a smaller context window if you're compiling for
wasm32), and these token counts could end up getting serialized using a
binary protocol, so `usize` is not the right choice for token counts.

I chose to standardize on `u64` over `u32` because we don't store many
of them (so the extra size should be insignificant) and future models
may exceed `u32::MAX` tokens.

Release Notes:

- N/A
2025-06-17 10:43:07 -04:00
..
model language_model: Remove CloudModel enum (#31322) 2025-05-24 02:04:51 +00:00
fake_provider.rs Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
language_model.rs Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
rate_limiter.rs More resilient eval (#32257) 2025-06-09 18:07:22 +00:00
registry.rs Distinguish between missing models and registries in error messages (#32678) 2025-06-13 10:31:52 +00:00
request.rs Pass up intent with completion requests (#31710) 2025-05-29 20:43:12 +00:00
role.rs language_model: Remove dependencies on individual model provider crates (#25503) 2025-02-24 16:41:35 -05:00
telemetry.rs Don't spawn Anthropic telemetry event when API key is missing (#32813) 2025-06-16 14:58:37 -04:00