mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Fix custom pricing - separate provider info from model info (#7990)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 34s
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 34s
* fix(utils.py): initial commit fixing custom cost tracking refactors out provider specific model info from `get_model_info` - this was causing custom costs to be registered incorrectly * fix(utils.py): cleanup `_supports_factory` to check provider info, if model info is None some providers support features like vision across all models * fix(utils.py): refactor to use _supports_factory * test: update testing * fix: fix linting errors * test: fix testing
This commit is contained in:
parent
d9b8100cca
commit
03eef5a2a0
10 changed files with 118 additions and 91 deletions
|
@ -5,17 +5,15 @@ from typing import List, Optional, Type, Union
|
|||
from openai.lib import _parsing, _pydantic
|
||||
from pydantic import BaseModel
|
||||
|
||||
from litellm.types.utils import ModelInfoBase
|
||||
from litellm.types.utils import ProviderSpecificModelInfo
|
||||
|
||||
|
||||
class BaseLLMModelInfo(ABC):
|
||||
@abstractmethod
|
||||
def get_model_info(
|
||||
def get_provider_info(
|
||||
self,
|
||||
model: str,
|
||||
existing_model_info: Optional[ModelInfoBase] = None,
|
||||
) -> Optional[ModelInfoBase]:
|
||||
pass
|
||||
) -> Optional[ProviderSpecificModelInfo]:
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def get_models(self) -> List[str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue