Skip to content

Add configurable streaming and embeddings support for OpenAI provider#3707

Closed
casassg wants to merge 5 commits intoblock:mainfrom
casassg:gerardc/add-oai-compatible-provider
Closed

Add configurable streaming and embeddings support for OpenAI provider#3707
casassg wants to merge 5 commits intoblock:mainfrom
casassg:gerardc/add-oai-compatible-provider

Conversation

@casassg
Copy link

@casassg casassg commented Jul 29, 2025

Summary

Adds OPENAI_ENABLE_STREAMING and OPENAI_ENABLE_EMBEDDINGS environment variables to allow disabling streaming and embeddings functionality in the OpenAI provider. Both default to true for backward compatibility.

Changes

  • Code: Added configurable boolean fields to OpenAiProvider struct and updated supports_streaming() and supports_embeddings() methods
  • Documentation: Updated provider configuration tables with the new optional parameters

Use Cases

  • OpenAI-compatible endpoints that don't support all features.

Configuration

export OPENAI_ENABLE_STREAMING=false    # Disable streaming
export OPENAI_ENABLE_EMBEDDINGS=false   # Disable embeddings

Backward Compatibility

✅ No breaking changes - all existing configurations continue to work unchanged.

@casassg casassg changed the title Add streaming toggle in OpenAI provider Add configurable streaming and embeddings support for OpenAI provider Jul 29, 2025
@michaelneale
Copy link
Collaborator

makes sense - but what is the need for this? to try things out? compatibility or preference?

@casassg
Copy link
Author

casassg commented Jul 30, 2025

makes sense - but what is the need for this? to try things out? compatibility or preference?

Compatibility. Some providers may not offer streaming (due to various reasons).

In this specific case its due to some issues w sagemaker streaming with OpenAI compatible endpoint.

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

I think there's no reason to make this specific to OpenAI - if we want to be able to override streaming and embedding, we should do this at the level where this is checked against the provider. I would like to keep the number of environment variables somewhat under control and the provider specific one especially.

I also think it should be called DISABLE since false is a better default

@DOsinga
Copy link
Collaborator

DOsinga commented Aug 5, 2025

I think we should close this, merge #3825 at which point we have true custom providers based on an engine and then we can add streamability etc as a feature of that json format. what do you think @casassg ?

@casassg
Copy link
Author

casassg commented Aug 6, 2025

Fine by me, lmk if I can help test the PR using openai compatible apis

@michaelneale
Copy link
Collaborator

thanks for this - will close this in favour of other inbound changes

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.

3 participants

Comments