Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support azure o3 model family for fake streaming workaround #8162

Conversation

byrongrogan
Copy link
Contributor

@byrongrogan byrongrogan commented Jan 31, 2025

Support o3 model family for fake streaming workaround from Azure

o3-mini is already available on Azure, but sadly it looks like it doesn't support streaming, just like the o1 models.

So this PR updates the logic for the fake streaming workaround to also support the o3 family. Note that there's a wider refactor to generalize the name of AzureOpenAIO1Config that I'm not making here.

Relevant issues

Fixes #8158

Type

🐛 Bug Fix

Changes

  • Added o3* to the list of models for the Azure fake streaming workaround

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

I didn't see any obvious tests in this area, so manually tested the fake streaming is now working with o3-mini, o1-mini, as well as non-streaming on o3-mini. Also validated that real streaming is still working with gpt-4o.

Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 4:23pm

litellm/utils.py Outdated
@@ -5997,7 +5997,7 @@ def get_provider_chat_config( # noqa: PLR0915
):
return litellm.AI21ChatConfig()
elif litellm.LlmProviders.AZURE == provider:
if litellm.AzureOpenAIO1Config().is_o1_model(model=model):
if litellm.AzureOpenAIO1Config().is_reasoning_model(model=model):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given the refactor will probably be to the o-series can we rename the helper util something like - is_o_series_model ?

it would just be clearer what it's really trying to do

@krrishdholakia krrishdholakia self-assigned this Feb 1, 2025
@krrishdholakia
Copy link
Contributor

I didn't see any obvious tests in this area

testing here @byrongrogan

class TestAzureOpenAIO1(BaseLLMChatTest):

the basellmchattest goes through a series of common scenarios for the model

it's fine - i can take care of this part, since this will probably require us to have an o3 deployment on azure

@krrishdholakia krrishdholakia changed the base branch from main to litellm_dev_02_01_2025_p1 February 1, 2025 16:39
@krrishdholakia krrishdholakia merged commit b553028 into BerriAI:litellm_dev_02_01_2025_p1 Feb 1, 2025
2 checks passed
krrishdholakia added a commit that referenced this pull request Feb 1, 2025
* fix: support azure o3 model family for fake streaming workaround (#8162)

* fix: support azure o3 model family for fake streaming workaround

* refactor: rename helper to is_o_series_model for clarity

* update function calling parameters for o3 models (#8178)

* refactor(o1_transformation.py): refactor o1 config to be o series config, expand o series model check to o3

ensures max_tokens is correctly translated for o3

* feat(openai/): refactor o1 files to be 'o_series' files

expands naming to cover o3

* fix(azure/chat/o1_handler.py): azure openai is an instance of openai - was causing resets

* test(test_azure_o_series.py): assert stream faked for azure o3 mini

Resolves #8162

* fix(o1_transformation.py): fix o1 transformation logic to handle explicit o1_series routing

* docs(azure.md): update doc with `o_series/` model name

---------

Co-authored-by: byrongrogan <47910641+byrongrogan@users.noreply.github.com>
Co-authored-by: Low Jian Sheng <15527690+lowjiansheng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: o3-mini - Azure OpenAI
2 participants