Podonos
This is a base module. You can import:python
init()
Initialize the module and return an instance ofClient.
string
API key you obtained from the workspace. For details, see the Get API key.
If this is not set, the package tries to read
PODONOS_API_KEY from the environment variable.
Throws an error if both of them are not available.string
default:"https://prod.podonosapi.com"
API base URL. You usually do not need to set this unless you are using a private, staging, or development API endpoint.
Client.
python
Client
Client manages one or more Evaluator instances and evaluation history.
create_evaluator()
Create a new instance ofEvaluator. One evaluator supports a single type of evaluation throughout its life cycle.
If you want multiple types of evaluation, create multiple evaluators by calling create_evaluator() multiple times.
string
Name of this evaluation session. If empty, a random name is automatically generated and used.
string
Description of this evaluation session. This field is for your records, so later you can see how you generated the output files or trained your model.
string
default:"NMOS"
Evaluation type. One of the following:
string
default:"en-us"
Specific language and locale of the speech. Currently we support:
We will add more soon. Please check later again.
float
default:"1.0"
Granularity of evaluation scales. Supported values are
1.0 and 0.5.int
default:"10"
Number of evaluations per sample. For example, if this is 10 for NMOS type evaluation, each audio file will be assigned to 10 humans, and the statistics of the evaluation output will be computed and presented in the final report.
int
default:"12"
Expected due time of the final report in hours. Must be at least
12. Depending on the hours, the pricing may change.bool
default:"False"
Enable annotation to collect free-form text feedback from evaluators.
bool
default:"True"
Enable loudness normalization to ensure consistent audio volume levels during evaluation.
bool
default:"False"
If
True, close() waits for the uploaded files to finish processing, then starts the evaluation and charges your workspace balance. It raises if it cannot start. If False, close() returns as soon as the uploads are done and nothing is charged until you start the evaluation yourself in Workspace. Requires podonos 0.46.0 or newer; earlier versions accept the parameter and silently ignore it.Pair it with resume_upload=True and an upload_state_path. If the start fails or times out, resume_evaluator() is the only way back to that evaluation; without a ledger you have to start it from Workspace instead.int
default:"20"
Maximum number of upload worker threads. If you experience a slow upload, please increase the number of workers.
int
default:"100"
Batch size for file verification API calls. Must be between
1 and 1000.tuple[float, float]
default:"(5, 30)"
Timeout tuple for API requests, in seconds.
tuple[float, float]
default:"(5, 120)"
Timeout tuple for file verification requests, in seconds.
tuple[float, float]
default:"(10, 300)"
Timeout tuple for direct file upload requests, in seconds.
bool
default:"False"
Enable SDK-local upload ledger/resume support. The ledger records upload progress and the original evaluation contract so interrupted uploads can be resumed safely.
string
default:"None"
Optional SQLite upload ledger path when
resume_upload=True. Use the same path with resume_evaluator() if the upload is interrupted.float
default:"1800"
Seconds
close() waits when auto_start=True. Must be positive. It limits when the SDK stops issuing new requests, so a request already in flight can finish somewhat after it. Lower it in CI, where a blocking close() costs runner time.Evaluator.
resume_evaluator()
Resume uploads for an existing evaluation using an SDK upload ledger. Add files again in the same order as the interrupted run so the ledger can recover each file’s remote object identity.Resume is safety-checked against the local ledger. The ledger must contain the original evaluation contract and session configuration for
evaluation_id; otherwise the SDK refuses to resume. The SDK restores the original session details from the ledger where available, so do not use resume_evaluator() to change the evaluation type, language, template, batch size, or file identities.During resume, completed ledger rows are reused only when the current local file still matches the recorded path, content hash, size, and upload manifest. If a completed metadata or verification row no longer matches the local file, start a fresh evaluation or remove the stale ledger row before resuming.string
required
Evaluation ID to resume.
string
required
Path to the SDK upload ledger created by a previous upload run. It must contain the original evaluation contract for
evaluation_id.string
Optional session name.
string
Optional session description.
string
default:"NMOS"
Evaluation type. Uses the same supported values as
create_evaluator().string
default:"en-us"
Language code. Uses the same supported values as
create_evaluator().float
default:"1.0"
Granularity of evaluation scales.
int
default:"10"
Number of evaluations per sample.
int
default:"12"
Expected due time of the final report in hours.
bool
default:"False"
Enable annotation to collect free-form text feedback from evaluators.
bool
default:"True"
Enable loudness normalization for evaluation.
bool
default:"False"
Restored from the resumed session’s ledger, so the value you pass here is ignored. If the original run set it,
close() blocks and starts the evaluation — charging your workspace balance — even when you pass False. The SDK logs a warning whenever the restored value disagrees with the one you passed. Requires podonos 0.46.0 or newer; earlier versions accept the parameter and silently ignore it.int
default:"20"
Maximum number of upload worker threads.
int
default:"100"
Batch size for file verification API calls.
tuple[float, float]
default:"(5, 30)"
Timeout tuple for API requests, in seconds.
tuple[float, float]
default:"(5, 120)"
Timeout tuple for file verification requests, in seconds.
tuple[float, float]
default:"(10, 300)"
Timeout tuple for direct file upload requests, in seconds.
float
default:"1800"
Seconds
close() waits when the restored auto_start is True. Unlike auto_start this is not restored from the ledger, so the value you pass here wins.python
create_evaluator_from_template()
When you create an evaluation using a template, all the questions and options defined in the template are automatically assigned to the new evaluation. This ensures consistency and saves time by reusing pre-defined content.string
required
Name of this evaluation session. Required and must be non-empty.
string
required
The unique identifier of the template to base the new evaluation on.
string
Description of this evaluation session. This field is for your records.
int
default:"10"
Number of evaluations per sample.
bool
default:"False"
Enable annotation to collect free-form text feedback from evaluators. Cannot be used together with an
annotations array in template JSON.bool
default:"True"
Enable loudness normalization to ensure consistent audio volume levels during evaluation.
bool
default:"False"
If
True, close() waits for the uploaded files to finish processing, then starts the evaluation and charges your workspace balance. It raises if it cannot start. If False, close() returns as soon as the uploads are done and nothing is charged until you start the evaluation yourself in Workspace. Requires podonos 0.46.0 or newer; earlier versions accept the parameter and silently ignore it.Pair it with resume_upload=True and an upload_state_path. If the start fails or times out, resume_evaluator() is the only way back to that evaluation; without a ledger you have to start it from Workspace instead.int
default:"20"
Maximum number of upload worker threads.
int
default:"100"
Batch size for file verification API calls.
tuple[float, float]
default:"(5, 30)"
Timeout tuple for API requests, in seconds.
tuple[float, float]
default:"(5, 120)"
Timeout tuple for file verification requests, in seconds.
tuple[float, float]
default:"(10, 300)"
Timeout tuple for direct file upload requests, in seconds.
bool
default:"False"
Enable SDK-local upload ledger/resume support. The ledger records upload progress and the original evaluation contract so interrupted uploads can be resumed safely.
string
default:"None"
Optional SQLite upload ledger path when
resume_upload=True. Use the same path with resume_evaluator() if the upload is interrupted.float
default:"1800"
Seconds
close() waits when auto_start=True. Must be positive. It limits when the SDK stops issuing new requests, so a request already in flight can finish somewhat after it. Lower it in CI, where a blocking close() costs runner time.create_evaluator_from_template_json()
Create a new evaluation using a JSON template. This allows you to define custom evaluation structures programmatically.Dict
Template JSON as a dictionary. Optional if
json_file is provided.string
Path to the JSON template file. Optional if
json is provided.string
Name of this evaluation session. Optional; if omitted, the SDK generates a name.
string | CustomType
default:"SINGLE"
Type of evaluation. Accepts either a string or
CustomType enum value.You can use string values (
"SINGLE", "DOUBLE", "SINGLE_REF", "RANKING", "RANKING_REF") or the CustomType enum from podonos.common.enum:string
Description of this evaluation session. Optional.
string
default:"en-us"
Language for evaluation. See supported languages in
create_evaluator().int
default:"10"
Number of evaluations per sample.
bool
default:"False"
Enable annotation to collect free-form text feedback from evaluators. Cannot be used together with an
annotations array in template JSON. When using custom annotation questions, define them in the annotations array instead.bool
default:"True"
Enable loudness normalization to ensure consistent audio volume levels during evaluation.
bool
default:"False"
If
True, close() waits for the uploaded files to finish processing, then starts the evaluation and charges your workspace balance. It raises if it cannot start. If False, close() returns as soon as the uploads are done and nothing is charged until you start the evaluation yourself in Workspace. Requires podonos 0.46.0 or newer; earlier versions accept the parameter and silently ignore it.Pair it with resume_upload=True and an upload_state_path. If the start fails or times out, resume_evaluator() is the only way back to that evaluation; without a ledger you have to start it from Workspace instead.int
default:"20"
Maximum number of upload workers. Must be a positive integer.
int
default:"100"
Batch size for file verification API calls.
tuple[float, float]
default:"(5, 30)"
Timeout tuple for API requests, in seconds.
tuple[float, float]
default:"(5, 120)"
Timeout tuple for file verification requests, in seconds.
tuple[float, float]
default:"(10, 300)"
Timeout tuple for direct file upload requests, in seconds.
bool
default:"False"
Enable SDK-local upload ledger/resume support. The ledger records upload progress and the original evaluation contract so interrupted uploads can be resumed safely.
string
default:"None"
Optional SQLite upload ledger path when
resume_upload=True. Use the same path with resume_evaluator() if the upload is interrupted.float
default:"1800"
Seconds
close() waits when auto_start=True. Must be positive. It limits when the SDK stops issuing new requests, so a request already in flight can finish somewhat after it. Lower it in CI, where a blocking close() costs runner time.Evaluator.
Here’s the JSON template for reference:
- Question
- Option
- Anchor Label
- Instruction
- Annotation
Question: Represents the main question posed to evaluators about the audio being assessed. It guides evaluators on the specific aspect of the audio they should focus on during the evaluation.Important Notes:
SCOREDandNON_SCOREDquestions can have a maximum of 9 options.NON_SCOREDquestions must specifyallow_multiple.COMPARISONtype questions must have a scale between 2 and 9.related_modelconsists ofALL,MODEL_AandMODEL_B. Default isALL. Therelated_modelis only used for the question (not for instructions).
flash_eval()
Run automatic evaluation on an audio file and return aFlashEvalResult.
string
required
Path to the audio file to evaluate.
string
Language code for model routing. Currently available:
en-us, es-es. When omitted, the default en-us model is used. Ignored when category="noise_quality".string
Evaluation category. Defaults to
naturalness when omitted. Currently available: naturalness, noise_quality.FlashEvalResult with these fields:
python
get_evaluation_list()
Returns a JSON containing all your evaluations, each with its current status and progress.progress, started_time and ended_time are reported by podonos 0.47.0 or newer. started_time and ended_time are null until the evaluation starts and ends, and all three are null when the service does not report them, so check for null before comparing.
An evaluation is finished when
status is "COMPLETED", never when progress reaches 100. progress is capped at 90 while the evaluation is running and stays at 90 during report review, so it cannot tell “almost done” from “done”. Use status to decide, and progress for display only.To check a single evaluation instead of listing the whole workspace, see get_evaluation_progress().get_evaluation_progress()
Returns the current status and progress of one evaluation, without listing the rest of the workspace. Requires podonos 0.47.0 or newer.string
required
Evaluation id. See
get_evaluation_list(), or Evaluator.get_evaluation_id() on an evaluator you created.EvaluationProgress with these fields. Call .to_dict() for the same values as a JSON-style dictionary.
Stop polling on
COMPLETED, CANCELED or DELETED. A deleted or hidden evaluation still reports its real status here, even though get_evaluation_list() no longer lists it.Decide on status, never on progress >= 100, for the reason given under get_evaluation_list().get_eval_template_info()
Gets detailed information about an evaluation template by its ID.string
The unique identifier of the evaluation template to retrieve information for.
get_stats_json_by_id()
Returns a list of JSONs containing the statistics of each stimulus for the evaluation referenced by theid.
string
Evaluation id. See
get_evaluation_list().string
default:"question"
Group by criteria. Options are “question”, “script”, or “model”. Default is “question”. Note that “script” and “model” are only available for single-question evaluations.
For NON_SCORED questions:
- The integer value is the number of evaluators who selected the option.
- All options are included in the response regardless of their value
- Single
- Double (including CSMOS)
You can get the statistics of each question by calling
get_stats_json_by_id() with group_by set to question, script, or model.download_evaluation_files_by_evaluation_id()
Download all files associated with a specific evaluation, identified by itsevaluation_id, from the Podonos evaluation service. It saves these files to a specified directory on the local file system and generates a metadata file describing the downloaded files.
Return a string indicating the status of the download operation. This could be a success message or an error message if the download fails.
string
Evaluation id. See
get_evaluation_list().string
The directory path where the downloaded files will be saved. This should be a valid path on the local file system where the user has write permissions.
File Naming Convention:Each downloaded file is saved in the format
{output_dir}/{model_tag}/{file_name}. This means that files are organized into subdirectories named after their model_tag, and the original file name is hashed formatted.File
A class representing one file, used for adding files inEvaluator.
string
required
Path to the file to evaluate. For audio files, we support
wav, mp3, and flac formats.string
required
Name of your model (e.g.,
WhisperTTS) or any unique name (e.g., human).list[string]
A list of string tags for the file designated by
path. You can use this field as properties of the file such as original, synthesized, tom, maria, and so on. Later you can look up or group files with particular tags in the output report.string
Text script of the input audio file.
bool
default:"False"
True if this file works as a reference in a comparative evaluation.
Dict[str, str | int | float | bool | None]
Optional metadata dictionary for the file. Keys must be strings, and values must be JSON-primitive values.
list[string]
Optional tags for the script. These are useful for ranking and script-level grouping.
python
Evaluator
Evaluator manages a single type of evaluation.
add_file()
Add one file to evaluate in a single evaluation question. For a single file evaluation likeNMOS, one file to evaluate is added.
File
required
Input
File. This field is required if type is NMOS, QMOS, P808, or CUSTOM_SINGLE.add_files()
Add multiple files for evaluations that require comparison.File
required
First input file.
File
required
Second input file.
File
Optional third input file. Used for
CSMOS evaluations with one reference and two stimuli.You do not need to keep a consistent argument order, and you should not shuffle it yourself. The SDK normalizes what it stores: stimuli are sorted by
model_tag (numeric-aware and case-insensitive) and the reference is stored last. The same model therefore occupies the same position in every group, which is what lets the platform attribute scores back to it.Presentation order is randomized per evaluator regardless — see Bias Minimization.The one positional rule left: for CSMOS the reference must be passed as file2.add_ranking_set()
Add one ranking set for aRANKING or RANKING_REF evaluation.
list[File]
required
Candidate files for one ranking group. For
RANKING_REF, include exactly one file with is_ref=True; its position in the list does not matter.- All groups must have the same number of files.
- The order of stimulus
model_tagmust be identical across groups. - Within a group, every
model_tagmust be unique, case-insensitively. The reference is included in this check, so it cannot reuse a candidate’s tag. RANKING: every file must be a stimulus. Settingis_ref=Trueraises.RANKING_REF: exactly one file withis_ref=Trueand at least two stimuli. The reference’smodel_tagmust be the same in every group.
model_tag accepts letters, digits, hyphens and underscores only. "Provider A" raises; use "Provider_A".close()
Close the evaluation session. Once this function is called, all the evaluation files will be sent to the Podonos evaluation service, the files will go through a series of processing, and delivered to evaluators. Returns a JSON object containing the uploading status.python
auto_start=True on podonos 0.46.0 or newer, close() does not return once the uploads finish. It waits for the files to become processable, starts the evaluation — charging your workspace balance — and returns only after the evaluation is running.
auto_start
close() with no files added raises a ValueError.
