Skip to content

Commit e3988f8

Browse files
Trigger model updates when token limit metadata changes
1 parent 14c0b03 commit e3988f8

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Backend sync worker service."""
22

3-
__version__ = "0.6.32"
3+
__version__ = "0.6.33"

backend/litellm_client.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ async def _needs_update(provider, model, litellm_model, config=None, session=Non
510510
logger.debug("Access groups changed: %s != %s", db_access_groups, ll_access_groups)
511511
return True
512512

513-
# Check pricing differences (with normalization to handle string/float inconsistencies)
513+
# Check token / context metadata differences
514514
effective_info = apply_pricing_overrides(
515515
model.effective_params,
516516
config=config,
@@ -520,6 +520,26 @@ async def _needs_update(provider, model, litellm_model, config=None, session=Non
520520
ll_info = litellm_model.get('model_info', {})
521521
ll_params = litellm_model.get('litellm_params', {})
522522

523+
for key in ("max_tokens", "max_input_tokens", "max_output_tokens", "context_window"):
524+
db_val = effective_info.get(key)
525+
ll_info_val = ll_info.get(key)
526+
ll_params_val = ll_params.get(key)
527+
528+
db_normalized = _normalize_value(db_val)
529+
ll_info_normalized = _normalize_value(ll_info_val)
530+
ll_params_normalized = _normalize_value(ll_params_val)
531+
532+
if db_normalized != ll_info_normalized or db_normalized != ll_params_normalized:
533+
logger.debug(
534+
"Token metadata changed for %s: ll_info=%s, ll_params=%s, db=%s",
535+
key,
536+
ll_info_val,
537+
ll_params_val,
538+
db_val,
539+
)
540+
return True
541+
542+
# Check pricing differences (with normalization to handle string/float inconsistencies)
523543
for key, value in effective_info.items():
524544
if "cost" not in key:
525545
continue

frontend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Frontend API and UI service."""
22

3-
__version__ = "0.6.32"
3+
__version__ = "0.6.33"

proxy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.32"
1+
__version__ = "0.6.33"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "litellm-companion"
3-
version = "0.6.32"
3+
version = "0.6.33"
44
description = "Synchronize models from Ollama or OpenAI-compatible endpoints into LiteLLM"
55
authors = [
66
{name = "LiteLLM Companion Authors", email = "dev@example.com"}

shared/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Shared code between backend and frontend services."""
22

3-
__version__ = "0.6.32"
3+
__version__ = "0.6.33"

0 commit comments

Comments
 (0)