jamiepine/voicebox · error · ValueError

Cloned profiles cannot use default engine '{default_engine}'

Error message

Cloned profiles cannot use default engine '{default_engine}'

What it means

Returned by _validate_profile_fields for the cloned branch when default_engine is set and is not in CLONING_ENGINES = {qwen, luxtts, chatterbox, chatterbox_turbo, tada}. Cloned profiles can only be synthesized by engines that support voice cloning; preset-only engines like kokoro/qwen_custom_voice are rejected here.

Source

Thrown at backend/services/profiles.py:173

    existing_profile = db.query(DBVoiceProfile).filter_by(name=data.name).first()
    if existing_profile:
        raise ValueError(f"A profile with the name '{data.name}' already exists. Please choose a different name.")

    # Auto-set default_engine for preset profiles
    default_engine = data.default_engine
    voice_type = data.voice_type or "cloned"
    if voice_type == "preset" and data.preset_engine and not default_engine:
        default_engine = data.preset_engine

    validation_error = _validate_profile_fields(
        voice_type=voice_type,
        preset_engine=data.preset_engine,
        preset_voice_id=data.preset_voice_id,
        design_prompt=data.design_prompt,
        default_engine=default_engine,
    )
    if validation_error:
        raise ValueError(validation_error)

    db_profile = DBVoiceProfile(
        id=str(uuid.uuid4()),
        name=data.name,
        description=data.description,
        language=data.language,
        voice_type=voice_type,
        preset_engine=data.preset_engine,
        preset_voice_id=data.preset_voice_id,
        design_prompt=data.design_prompt,
        default_engine=default_engine,
        personality=data.personality,
        created_at=datetime.utcnow(),
        updated_at=datetime.utcnow(),
    )

    db.add(db_profile)
    db.commit()

View on GitHub (pinned to 51f49dea19)

Solutions

  1. Set default_engine to a cloning-capable engine: one of qwen, luxtts, chatterbox, chatterbox_turbo, tada.
  2. Omit default_engine to let the backend pick the default cloning engine.
  3. If you actually want kokoro/qwen_custom_voice, that is a preset voice — use voice_type:'preset' instead.

Example fix

// before
{"name":"Echo","voice_type":"cloned","default_engine":"kokoro"}
// after
{"name":"Echo","voice_type":"cloned","default_engine":"chatterbox"}
Defensive patterns

Strategy: validation

Validate before calling

CLONING_ENGINES = {"qwen", "luxtts", "chatterbox", "chatterbox_turbo", "tada"}

def cloned_engine_ok(data) -> bool:
    vt = data.voice_type or "cloned"
    return vt != "cloned" or not data.default_engine or data.default_engine in CLONING_ENGINES

if not cloned_engine_ok(data):
    raise HTTPException(400, f"{data.default_engine} is not a cloning engine")

Type guard

def is_valid_cloned_engine(engine: str | None) -> bool:
    return engine is None or engine in {"qwen", "luxtts", "chatterbox", "chatterbox_turbo", "tada"}

Prevention

When it happens

Trigger: POSTing voice_type:'cloned' (or omitted) with default_engine:'kokoro' or any value outside the cloning set.

Common situations: Defaulting default_engine to a global TTS setting that happens to be a preset-only engine; upgrading the backend and an engine name changed; typo in the engine string.

Related errors


AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12). Data as JSON: /api/errors/d25ff86ecf6cb8b1. Report an issue: GitHub.