Skip to content

feat: add service_tier parameter to Responses API LLM#5346

Merged
tinalenguyen merged 3 commits intolivekit:mainfrom
piyush-gambhir:feat/responses-service-tier-param
Apr 12, 2026
Merged

feat: add service_tier parameter to Responses API LLM#5346
tinalenguyen merged 3 commits intolivekit:mainfrom
piyush-gambhir:feat/responses-service-tier-param

Conversation

@piyush-gambhir
Copy link
Copy Markdown
Contributor

Summary

The Chat Completions LLM (openai.LLM) already supports the service_tier parameter 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_tier to the Responses LLM for parity.

Changes

livekit-plugins/livekit-plugins-openai/.../responses/llm.py (1 file):

  • Add service_tier: NotGivenOr[str] to _LLMOptions
  • Add service_tier parameter to LLM.__init__()
  • Pass service_tier through in chat() via extra kwargs

Usage

```python
from livekit.plugins.openai import responses

llm = responses.LLM(
model="gpt-5.4",
service_tier="priority", # now supported
)
```

Backward Compatible

  • Defaults to `NOT_GIVEN` — no impact on existing code
  • Matches the existing pattern used by the Chat Completions LLM (`NotGivenOr[str]`)

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
Copy link
Copy Markdown
Contributor

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

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

@piyush-gambhir
Copy link
Copy Markdown
Contributor Author

Raised the same PR for for agents-js and it got merged. Sharing that for reference.
livekit/agents-js#1206

@tinalenguyen
Copy link
Copy Markdown
Member

hi @piyush-gambhir, thank you for the PR! lgtm, could you remove the changeset file?

@piyush-gambhir
Copy link
Copy Markdown
Contributor Author

hi @piyush-gambhir, thank you for the PR! lgtm, could you remove the changeset file?

Sure @tinalenguyen.

@piyush-gambhir
Copy link
Copy Markdown
Contributor Author

@tinalenguyen. Removed the changeset file.

Copy link
Copy Markdown
Member

@tinalenguyen tinalenguyen left a comment

Choose a reason for hiding this comment

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

thanks for iterating, i just left another comment 🙏

Comment thread livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/responses/llm.py Outdated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@piyush-gambhir
Copy link
Copy Markdown
Contributor Author

@tinalenguyen Made the changes as requested.

Copy link
Copy Markdown
Member

@tinalenguyen tinalenguyen left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@tinalenguyen tinalenguyen merged commit b0f0cc9 into livekit:main Apr 12, 2026
14 checks passed
russellmartin-livekit pushed a commit that referenced this pull request Apr 13, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
osimhi213 added a commit to de-id/livekit-agents that referenced this pull request Apr 15, 2026
* upstream/main: (31 commits)
  chore: reduce renovate noise (livekit#5421)
  Rename e2ee to encryption in JobContext.connect (livekit#5454)
  feat: add Runway Characters avatar plugin (livekit#5355)
  Fix FrameProcessor lifecycle for selector based noise cancellation (livekit#5433)
  Feature - Configurable session close transcript timeout (livekit#5328)
  add ToolSearchToolset and ToolProxyToolset for dynamic tool discovery (livekit#5140)
  feat(beta/workflows): add InstructionParts for modular instruction customization (livekit#5077)
  fix: allow multiple AsyncToolsets by deduplicating management tools (livekit#5369)
  fix: empty transcript blocks commit_user_turn until timeout (livekit#5429)
  Feature/krisp viva sdk support (livekit#4370)
  feat: add service_tier parameter to Responses API LLM (livekit#5346)
  fix(inworld): do not leak connections when when cancelled (livekit#5427)
  update: Sarvam STT - add verbose error loggin and remove retry connection (livekit#5373)
  chore(deps): update github workflows (major) (livekit#5424)
  (azure openai): ensure gpt-realtime-1.5 compatibility (livekit#5407)
  chore(deps): update dependency nltk to v3.9.4 [security] (livekit#5418)
  chore(deps): update dependency aiohttp to v3.13.4 [security] (livekit#5416)
  chore(deps): update dependency langchain-core to v1.2.28 [security] (livekit#5417)
  chore: pin GHA by commit (livekit#5415)
  fix(aws): unwrap doubly-encoded JSON tool arguments from Nova Sonic (livekit#5411)
  ...
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