Hume Audio Decisions
deepeval supports using Hume's Audio Decisions API as the audio decision model for its voice metrics under the hybrid voice eval mode, and uses it by default there. An audio decision model is a decision model that listens instead of reads: it hears a recording and answers bounded questions about it (yes/no, or one option from a set) with a probability. To get started, you'll need to set up your Hume API key.
Voice metrics such as Echo or Abrupt Cut-off detect events in a call recording with signal processing, which is fast but can flag things a person wouldn't call a problem. In hybrid mode, the audio decision model hears a short clip around each flagged event and dismisses the ones it judges not real before the metric is scored.
Setting Up Your API Key
DeepEval autoloads .env.local then .env at import time (process env -> .env.local -> .env).
Recommended (local dev):
# .env.local
HUME_API_KEY=<your-hume-api-key>Alternative (Shell/CI):
export HUME_API_KEY=<your-hume-api-key>Alternative (notebook):
If you're working in a notebook environment (Jupyter or Colab), set your HUME_API_KEY in a cell:
%env HUME_API_KEY=<your-hume-api-key>Command Line
Voice metrics run in the deterministic voice eval mode by default, which calls no model. To double-check flagged events with Hume in every voice metric, run:
deepeval set-voice-eval-mode hybridIn Code
To use Hume for the check, define a HumeDecisionModel and pass it as the voice metric's audio_decision_model. By default, the model is set to audio-decisions.
from deepeval.metrics import EchoMetric
from deepeval.models import HumeDecisionModel
model = HumeDecisionModel(model="audio-decisions")
echo = EchoMetric(
audio_decision_model=model,
eval_mode="hybrid",
)There are ZERO mandatory and FOUR optional parameters when creating a HumeDecisionModel:
- [Optional]
model: A string specifying the name of the Hume model to use. Defaulted toaudio-decisions. - [Optional]
api_key: A string specifying your Hume API key. Defaults toHUME_API_KEYif not passed; raises an error if neither is set. - [Optional]
cost_per_input_token: A float overriding the per-token price used for cost accounting. Defaults to the built-in price for the model ($0.47 per million input tokens). - [Optional]
timeout: A float number of seconds to wait on a request before giving up. Defaulted to60.0.
First set your API key and the voice eval mode:
# .env.local
HUME_API_KEY=<your-hume-api-key>
DEEPEVAL_VOICE_EVAL_MODE=hybriddeepeval set-voice-eval-mode hybrid writes DEEPEVAL_VOICE_EVAL_MODE for you. Voice metrics then check flagged events with Hume without any arguments:
from deepeval.metrics import EchoMetric
echo = EchoMetric()An eval_mode passed to the metric wins over DEEPEVAL_VOICE_EVAL_MODE. In deterministic mode, an audio_decision_model you pass is not used.
Supported Metrics
These voice metrics accept an audio_decision_model and an eval_mode:
| Metric | Class | Question asked about each flagged clip |
|---|---|---|
| Abrupt Cut-off | AbruptCutoffMetric | Does the speaker's voice cut off abruptly, mid-word or mid-sentence? |
| Audio Dropout | AudioDropoutMetric | Does the speaker's audio suddenly drop out or go silent mid-word, then come back? |
| Dead Stream | DeadStreamMetric | Does the speaker's audio go completely dead partway through, as if the line dropped? |
| Echo | EchoMetric | Can the AI agent's own voice be heard echoed back on this caller's line? |
| Background Noise | BackgroundNoiseMetric | Is there distracting background noise behind the speaker? |
| Abrupt Pitch Jump | AbruptPitchJumpMetric | Does the speaker's voice suddenly jump to a different pitch, as if it glitched or cracked? |
| Pauses | PausesMetric | Does the speaker stop for an unnaturally long time in the middle of what they are saying? Is most of this clip silence where the speaker should be talking? |
| Pitch Variation | PitchVariationMetric | Does the speaker sound flat and monotone, like a robot reading? Does the speaker's pitch swing up and down erratically, in a way that sounds unnatural? |
| Speaking Rate | SpeakingRateMetric | Is the speaker talking unnaturally slowly? Is the speaker talking unnaturally fast? |
| Failed Response | FailedResponseMetric | Does the AI agent stay silent here instead of answering? |
| Silent Reply | SilentReplyMetric | Is the AI agent silent here, saying no words? |
| Agent Interruption | AgentInterruptionMetric | Is a person speaking in this clip, rather than only background noise, breathing or silence? |
| User Interruption | UserInterruptionMetric | Is a person speaking in this clip, rather than only background noise, breathing or silence? |
For each flagged event, deepeval cuts a clip of at least 5 seconds around it, or the whole reply for an event judged on a whole reply, and asks the question above. Events the model gives less than a 50% yes are dropped before scoring. A clip that can't be cut, or a check that fails, keeps the event, so an API error never makes a metric more lenient. The exception is an event only flagged for the model to confirm, which doesn't count when it can't be heard. Speaking Rate and Abrupt Pitch Jump also send borderline replies to the model, so in hybrid they can flag a reply the deterministic check would pass.
Composite metrics that include any of these, such as Voice Naturalness, take audio_decision_model and eval_mode too, and pass them to those parts.
Available Hume Models
audio-decisions(default)