fix openai_like_chat_completion

This commit is contained in:
Ishaan Jaff 2025-01-02 16:35:19 -08:00
parent bb329e7267
commit c3e87a9651
2 changed files with 8 additions and 4 deletions

View file

@ -2824,7 +2824,7 @@ def completion( # type: ignore # noqa: PLR0915
return response
response = model_response
elif custom_llm_provider == "openai_like":
response = openai_like_chat.completion(
response = openai_like_chat_completion.completion(
model=model,
messages=messages,
api_base=api_base,
@ -2834,6 +2834,10 @@ def completion( # type: ignore # noqa: PLR0915
litellm_params=litellm_params,
logger_fn=logger_fn,
encoding=encoding,
custom_llm_provider=custom_llm_provider,
api_key=api_key,
logging_obj=logging,
custom_prompt_dict=custom_prompt_dict,
)
elif custom_llm_provider == "petals" or model in litellm.petals_models:
api_base = api_base or litellm.api_base

View file

@ -1,6 +1,6 @@
model_list:
- model_name: "openai_like/*"
- model_name: "fake-openai-endpoint"
litellm_params:
model: openai_like/*
api_base: https://exampleopenaiendpoint-production.up.railway.app/
model: openai_like/any
api_base: https://exampleopenaiendpoint-production.up.railway.app
api_key: "ishaan"