Код: Выделить всё
model_list:
- model_name: "text-embedding-3-small"
litellm_params:
model: "custom_llm_router/text-embedding-3-small"
...
Код: Выделить всё
from litellm import CustomLLM
from litellm.types.utils import ModelResponse
from litellm.utils import EmbeddingResponse
...
class CustomChat(CustomLLM):
def __init__(self):
...
def embedding(self, *args, **kwargs) -> EmbeddingResponse:
...
def aembedding(self, *args, **kwargs) -> EmbeddingResponse:
...
Вызов/клиента:
Код: Выделить всё
response = client.embeddings.create(
model= "text-embedding-3-small",
input=["Hello World"]
)
Код: Выделить всё
LiteLLM: Proxy initialized with Config, Set models:
text-embedding-3-small
custom-gpt-5
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:4000 (Press CTRL+C to quit)
...
...
...
litellm.exceptions.UnsupportedParamsError: litellm.UnsupportedParamsError: Setting {'encoding_format': 'base64'} is not supported by custom_llm_router. To drop it from the call, set `litellm.drop_params = True`.. Received Model Group=text-embedding-3-small
Available Model Group Fallbacks=None LiteLLM Retried: 1 times, LiteLLM Max Retries: 2
INFO: 127.0.0.1:52405 - "POST /embeddings HTTP/1.1" 400 Bad Request
Подробнее здесь: https://stackoverflow.com/questions/798 ... in-litellm