mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
fix(router): expose input_cost_per_reference_pixel on ModelGroupInfo
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
This commit is contained in:
parent
6a1bf0e704
commit
4347e20149
2 changed files with 21 additions and 3 deletions
|
|
@ -791,6 +791,7 @@ class ModelGroupInfo(BaseModel):
|
|||
input_cost_per_token: float | None = None
|
||||
output_cost_per_token: float | None = None
|
||||
input_cost_per_pixel: float | None = None
|
||||
input_cost_per_reference_pixel: float | None = None
|
||||
mode: (
|
||||
str
|
||||
| Literal["chat", "embedding", "completion", "image_generation", "audio_transcription", "rerank", "moderations"]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
from pydantic import ValidationError
|
||||
|
|
@ -229,7 +230,23 @@ def test_model_info_rejects_offset_aware_access_window_times():
|
|||
with pytest.raises(ValidationError):
|
||||
ModelInfo(
|
||||
id="x",
|
||||
access_windows=[
|
||||
{"start": "22:00+05:00", "end": "06:00", "timezone": "UTC", "team_ids": ["t"]}
|
||||
],
|
||||
access_windows=[{"start": "22:00+05:00", "end": "06:00", "timezone": "UTC", "team_ids": ["t"]}],
|
||||
)
|
||||
|
||||
|
||||
def test_model_group_info_surfaces_input_cost_per_reference_pixel():
|
||||
from litellm import Router
|
||||
|
||||
configured_rate: Final = 3e-7
|
||||
router: Final = Router(
|
||||
model_list=[
|
||||
{
|
||||
"model_name": "flux-edit",
|
||||
"litellm_params": {"model": "azure_ai/FLUX.2-flex"},
|
||||
"model_info": {"id": "dep-flux-1", "input_cost_per_reference_pixel": configured_rate},
|
||||
}
|
||||
]
|
||||
)
|
||||
group: Final = router.get_model_group_info("flux-edit")
|
||||
assert group is not None
|
||||
assert group.input_cost_per_reference_pixel == configured_rate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue