feat: add service_tier parameter to Responses API LLM#5346
Open
piyush-gambhir wants to merge 1 commit intolivekit:mainfrom
Open
feat: add service_tier parameter to Responses API LLM#5346piyush-gambhir wants to merge 1 commit intolivekit:mainfrom
piyush-gambhir wants to merge 1 commit intolivekit:mainfrom
Conversation
The Chat Completions LLM (openai.LLM) already supports the service_tier parameter for configuring priority/flex/default processing. This adds the same parameter to the Responses API LLM (openai.responses.LLM) for parity. OpenAI's Responses API accepts service_tier in the request body: https://platform.openai.com/docs/api-reference/responses/create Changes (responses/llm.py only): - Add service_tier to _LLMOptions dataclass - Add service_tier parameter to LLM.__init__() - Pass service_tier through in chat() via extra kwargs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Chat Completions LLM (
openai.LLM) already supports theservice_tierparameter for configuring priority/flex/default processing per-request. The Responses API LLM (openai.responses.LLM) is missing this parameter despite the OpenAI Responses API supporting it.This PR adds
service_tierto the Responses LLM for parity.Changes
livekit-plugins/livekit-plugins-openai/.../responses/llm.py(1 file):service_tier: NotGivenOr[str]to_LLMOptionsservice_tierparameter toLLM.__init__()service_tierthrough inchat()via extra kwargsUsage
```python
from livekit.plugins.openai import responses
llm = responses.LLM(
model="gpt-5.4",
service_tier="priority", # now supported
)
```
Backward Compatible