Model lists you can read
The chat's model picker shows name, context window (CTX 131K) and an eye for vision, on shared column tracks; the capability tags are gone from it. Settings -> Models gives the name its own row and wraps the tags beneath. The picker's tick now follows an in-place choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,26 @@ def stable_hue(value: str) -> int:
|
||||
|
||||
templates.env.filters["stable_hue"] = stable_hue
|
||||
|
||||
|
||||
def context_size(tokens: int | None) -> str:
|
||||
"""A context window as a model list shows it: 131072 -> "131K".
|
||||
|
||||
Decimal thousands, because that is how the number is quoted everywhere a
|
||||
person reads it, and a picker that said "128K" for a 131072-token model
|
||||
would disagree with the admin page's own figure. Empty for an unknown size,
|
||||
so the column slot is still emitted and the next row does not shift.
|
||||
"""
|
||||
if not tokens or tokens <= 0:
|
||||
return ""
|
||||
if tokens < 1000:
|
||||
return str(tokens)
|
||||
if tokens < 1_000_000:
|
||||
return f"{round(tokens / 1000)}K"
|
||||
return f"{tokens / 1_000_000:.1f}".removesuffix(".0") + "M"
|
||||
|
||||
|
||||
templates.env.filters["context_size"] = context_size
|
||||
|
||||
# A user's own message: escaped here and marked up, so `@mentions` read as
|
||||
# references rather than as punctuation. A filter rather than a context value
|
||||
# because the message templates are included from four different handlers and
|
||||
|
||||
Reference in New Issue
Block a user