Skip to content

feat(baseten): support top_p, presence_penalty, frequency_penalty#1217

Merged
toubatbrian merged 1 commit intolivekit:mainfrom
chasef07:baseten-sampling-params
Apr 9, 2026
Merged

feat(baseten): support top_p, presence_penalty, frequency_penalty#1217
toubatbrian merged 1 commit intolivekit:mainfrom
chasef07:baseten-sampling-params

Conversation

@chasef07
Copy link
Copy Markdown
Contributor

@chasef07 chasef07 commented Apr 9, 2026

Summary

Adds three documented Baseten sampling parameters to BasetenLLMOptions:

  • topP → forwarded as top_p
  • presencePenalty → forwarded as presence_penalty
  • frequencyPenalty → forwarded as frequency_penalty

These mirror how temperature and maxTokens are already plumbed through the plugin. Baseten's inference docs list all four as supported options.

Details

  • New fields on BasetenLLMOptions in plugins/baseten/src/types.ts with TSDoc.
  • Forwarded through the internal LLMOptions interface and into the extras bag in OpenAILLM.chat() in plugins/baseten/src/llm.ts.
  • The Baseten LLM subclass constructor passes the new fields into super({...}).
  • Drive-by: switched the existing temperature plumbing from a truthy check to !== undefined so that temperature: 0 is preserved (previously dropped silently).
  • Uses !== undefined for all three new fields so 0 is a valid value.

Test plan

  • pnpm -w format:write clean
  • pnpm --filter @livekit/agents-plugin-baseten lint clean
  • pnpm --filter @livekit/agents-plugin-baseten... build succeeds
  • Exercised live against Baseten inference endpoint (requires BASETEN_API_KEY)

Adds `topP`, `presencePenalty`, and `frequencyPenalty` to `BasetenLLMOptions`,
forwarded to Baseten's OpenAI-compatible endpoint as `top_p`, `presence_penalty`,
and `frequency_penalty` respectively. These are documented sampling parameters
for Baseten inference.

Also switches the existing `temperature` plumbing from a truthy check to
`!== undefined` so that `temperature: 0` is preserved.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: d201fdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@livekit/agents-plugin-baseten Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

@toubatbrian toubatbrian merged commit 4a965af into livekit:main Apr 9, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 9, 2026
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