Module livekit.plugins.krisp.auth

Authentication providers for the Krisp plugin.

These types are plain configuration holders — :class:KrispVivaFilterFrameProcessor dispatches on isinstance(…) to pick the matching internal FrameProcessor implementation.

  • :class:LiveKitCloudAuthProvider (default): selects the closed-source krisp_audio_livekit_internal wheel. The wheel bundles the model and authenticates against LiveKit Cloud using the room's JWT, which the agent framework hands to the FrameProcessor via the standard _on_credentials_updated callback.
  • :class:KrispLicenseAuthProvider: selects the public krisp_audio wheel with a Krisp license key + .kef model file.

Recommended call sites use the snake_case aliases via the auth namespace::

from livekit.plugins import krisp

krisp.auth.livekit_cloud()
krisp.auth.krisp_license(license_key="...", model_path="...")

Classes

class KrispLicenseAuthProvider (*, license_key: str | None = None, model_path: str | None = None)
Expand source code
class KrispLicenseAuthProvider:
    """Krisp-direct auth using a license key + ``.kef`` model file.

    Defaults to reading ``KRISP_VIVA_SDK_LICENSE_KEY`` and
    ``KRISP_VIVA_FILTER_MODEL_PATH`` from the environment.
    """

    def __init__(
        self,
        *,
        license_key: str | None = None,
        model_path: str | None = None,
    ) -> None:
        resolved_license_key = license_key or os.getenv("KRISP_VIVA_SDK_LICENSE_KEY") or ""
        resolved_model_path = model_path or os.getenv("KRISP_VIVA_FILTER_MODEL_PATH")

        if not resolved_model_path:
            raise ValueError(
                "Krisp model path is required. Pass model_path=... or set "
                "KRISP_VIVA_FILTER_MODEL_PATH."
            )
        if not resolved_model_path.endswith(".kef"):
            raise ValueError("Krisp model must have .kef extension")
        if not os.path.isfile(resolved_model_path):
            raise FileNotFoundError(f"Krisp model file not found: {resolved_model_path}")

        self.license_key: str = resolved_license_key
        self.model_path: str = resolved_model_path

Krisp-direct auth using a license key + .kef model file.

Defaults to reading KRISP_VIVA_SDK_LICENSE_KEY and KRISP_VIVA_FILTER_MODEL_PATH from the environment.

class krisp_license (*, license_key: str | None = None, model_path: str | None = None)
Expand source code
class KrispLicenseAuthProvider:
    """Krisp-direct auth using a license key + ``.kef`` model file.

    Defaults to reading ``KRISP_VIVA_SDK_LICENSE_KEY`` and
    ``KRISP_VIVA_FILTER_MODEL_PATH`` from the environment.
    """

    def __init__(
        self,
        *,
        license_key: str | None = None,
        model_path: str | None = None,
    ) -> None:
        resolved_license_key = license_key or os.getenv("KRISP_VIVA_SDK_LICENSE_KEY") or ""
        resolved_model_path = model_path or os.getenv("KRISP_VIVA_FILTER_MODEL_PATH")

        if not resolved_model_path:
            raise ValueError(
                "Krisp model path is required. Pass model_path=... or set "
                "KRISP_VIVA_FILTER_MODEL_PATH."
            )
        if not resolved_model_path.endswith(".kef"):
            raise ValueError("Krisp model must have .kef extension")
        if not os.path.isfile(resolved_model_path):
            raise FileNotFoundError(f"Krisp model file not found: {resolved_model_path}")

        self.license_key: str = resolved_license_key
        self.model_path: str = resolved_model_path

Krisp-direct auth using a license key + .kef model file.

Defaults to reading KRISP_VIVA_SDK_LICENSE_KEY and KRISP_VIVA_FILTER_MODEL_PATH from the environment.

class LiveKitCloudAuthProvider
Expand source code
class LiveKitCloudAuthProvider:
    """Marker for the LiveKit Cloud-bundled Krisp backend.

    Auth + metering happen inside ``krisp_audio_livekit_internal``, which
    receives the room JWT via the standard FrameProcessor
    ``_on_credentials_updated`` callback (forwarded by the facade). No
    constructor arguments — there is nothing to configure on this side.
    """

Marker for the LiveKit Cloud-bundled Krisp backend.

Auth + metering happen inside krisp_audio_livekit_internal, which receives the room JWT via the standard FrameProcessor _on_credentials_updated callback (forwarded by the facade). No constructor arguments — there is nothing to configure on this side.

class livekit_cloud
Expand source code
class LiveKitCloudAuthProvider:
    """Marker for the LiveKit Cloud-bundled Krisp backend.

    Auth + metering happen inside ``krisp_audio_livekit_internal``, which
    receives the room JWT via the standard FrameProcessor
    ``_on_credentials_updated`` callback (forwarded by the facade). No
    constructor arguments — there is nothing to configure on this side.
    """

Marker for the LiveKit Cloud-bundled Krisp backend.

Auth + metering happen inside krisp_audio_livekit_internal, which receives the room JWT via the standard FrameProcessor _on_credentials_updated callback (forwarded by the facade). No constructor arguments — there is nothing to configure on this side.