Skip to content

DOC: Document server_vad and ServerVadConfig on the Realtime Target page #4501

Open

Description

@romanlutz

RealtimeTarget uses server-side voice activity detection (VAD) to decide when the speaker has finished a turn. The server_vad constructor argument accepts True (default tuning), False, or a ServerVadConfig with custom tuning. ServerVadConfig is exported from pyrit.prompt_target, but the Realtime Target page does not mention server_vad or the config at all.

ServerVadConfig has three fields:

Field Default Valid range
threshold 0.4 0.0 to 1.0
prefix_padding_ms 200 0 or more
silence_duration_ms 1500 0 or more

What to change

Add a short section to doc/code/targets/realtime_target.py that covers:

  • What server-side VAD does for a realtime conversation, and what each of the three fields controls. Take the meaning of the fields from the RealtimeTarget code and the Realtime API documentation, and link the latter.
  • When someone would change the defaults (for example, audio with long pauses that gets cut off early).
  • A code example constructing RealtimeTarget(server_vad=ServerVadConfig(...)), and a sentence on what server_vad=False does.

Executing this notebook needs a Realtime API endpoint. If you have none, make the same edit by hand in both the .py and .ipynb files without re-executing the notebook, and say so in the PR.

Done when

  • The page explains server_vad and ServerVadConfig with a construction example.
  • The field names, defaults and ranges match the code.
  • The .py and .ipynb files match, and pre-commit passes.

Implementation notes

  • Doc pages under doc/code/ are jupytext pairs: a .py file and a matching .ipynb. Change both. doc/contributing/7_notebooks.md and .github/instructions/docs.instructions.md explain how.
  • Read the class and its unit tests first, and describe only what the code does today.
  • Keep the text short and concrete. Lead with when someone would use the class, then show the smallest example that works.
  • pre-commit runs the doc validation hooks; they must pass.

How to contribute

  • Claim it first. Before you start, comment on this issue to say you are taking it.
  • First comment wins. If yours is the first claim comment, go ahead and open a PR; you do not need to wait for a reply. If someone has already commented, this issue is taken, so please pick a different one.
  • Link this issue in your PR description.

Activity

  1. seung-waedet commented on Nov 21, 2026

    @seung-waedet

    I’d like to take this one. I’ll add a short server-side VAD section to the Realtime Target page covering server_vad and ServerVadConfig, with an example. I don’t have a Realtime endpoint, so I’ll edit the .py and .ipynb by hand and say so in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions