Skip to content

fix(deps): pin openai below 3 - #6831

Merged
longcw merged 3 commits into
mainfrom
longc/azure-openai-dep
Aug 13, 2026
Merged

fix(deps): pin openai below 3#6831
longcw merged 3 commits into
mainfrom
longc/azure-openai-dep

Conversation

@longcw

@longcw longcw commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

OpenAI 3 makes HTTPX2 the default client and no longer installs httpx. livekit-agents imports httpx in inference/llm.py and never declared it. Twelve plugins import it too, and none of them declared it. They all received it through openai.

That supply is gone, so a fresh install of the current release fails:

$ pip install livekit-agents
$ python -c "import livekit.agents"
ModuleNotFoundError: No module named 'httpx'

Every install since OpenAI 3.0.0 shipped is affected.

Fix

Pin openai below 3. Every openai 2.x release depends on httpx, so this one line restores the supply for core and for all twelve plugins.

A move to HTTPX2 is the durable answer, but it changes the public timeout: httpx.Timeout parameter on nine plugin constructors. That belongs in a minor release. #6826 starts this work for the inference client.

This branch also corrects two plugins that import the openai plugin and never declared it. azure/responses/llm.py and baseten/llm.py import it, and each package imports those modules from its __init__.py, so the dependency is not optional. A clean install of either plugin fails with ImportError: cannot import name 'openai' from 'livekit.plugins'. That fault is older than OpenAI 3 and is independent of the pin.

azure/responses/llm.py does `from livekit.plugins import openai`, and
azure/__init__.py imports that module, so the openai plugin is a hard
dependency. It was never declared, so a clean install of the plugin cannot
import it.

Declare it through the livekit-agents openai extra, the form cerebras, groq,
perplexity, sarvam and xai already use.
@longcw
longcw requested a review from a team as a code owner August 13, 2026 01:42

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

OpenAI 3 makes HTTPX2 the default client and no longer installs httpx.
livekit-agents imports httpx in inference/llm.py, and twelve plugins import
it too, none of them declaring it. They all received it through openai, so a
fresh install now fails at `import livekit.agents`.

Pin openai below 3 to restore that supply. Every openai 2.x still depends on
httpx, so this is the whole fix for core and for the plugins.

Migrating to HTTPX2 changes the public `timeout: httpx.Timeout` parameter on
nine plugin constructors, so it belongs in a minor release rather than here.
@longcw longcw changed the title fix(azure): declare the openai plugin it imports fix(deps): pin openai below 3 Aug 13, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

baseten/llm.py does `from livekit.plugins.openai import LLM`, and
baseten/__init__.py imports that module, so the openai plugin is a hard
dependency. It was never declared, so a clean install of the plugin cannot
import it.

Declare it through the livekit-agents openai extra, matching azure.
@longcw
longcw merged commit a9141ef into main Aug 13, 2026
25 checks passed
@longcw
longcw deleted the longc/azure-openai-dep branch August 13, 2026 02:30
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.

2 participants