# GenAIExecutable

- *class* qairt.gen\_ai\_api.executors.gen\_ai\_executable.GenAIExecutable

    - Bases: `ABC`

- *abstract* clean\_environment() → [GenAIExecutable](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-executors.html#qairt.gen_ai_api.executors.gen_ai_executable.GenAIExecutable)

    - Removes artifacts from target environment.

- *abstract* generate(*prompt: GenerationRequest*) → GenerationExecutionResult

    - Executes a generation request.

Concrete executors should return a subclass of <cite>GenerationExecutionResult</cite>
(e.g., <cite>TextGenerationResult</cite>, <cite>ImageGenerationResult</cite>).

- Parameters

    - **prompt** – The generation request containing the input messages.

- Returns

    - A <cite>GenerationExecutionResult</cite> (or subclass) with the generation
output.

- *abstract* prepare\_environment() → [GenAIExecutable](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-executors.html#qairt.gen_ai_api.executors.gen_ai_executable.GenAIExecutable)

    - Prepares artifacts for execution on target.

# GenAIExecutor

Deprecated: This module has been renamed to `gen_ai_executable`.

Please update your imports:

# Old (deprecated)
    from qairt.gen_ai_api.executors.gen_ai_executor import GenAIExecutor
    
    # New
    from qairt.gen_ai_api.executors.gen_ai_executable import GenAIExecutable
    Copy to clipboard

This compatibility shim will be removed in a future release.

## T2TExecutor

- *class* qairt.gen\_ai\_api.executors.t2t\_executor.T2TExecutor(*models: List[[CompiledModel](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-core-api.html#qairt.CompiledModel)]*, *genai\_config: [GenAIConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-configs.html#qairt.gen_ai_api.configs.gen_ai_config.GenAIConfig)*, *backend: [BackendType](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-configs.html#qairt.api.configs.common.BackendType)*, *device: Optional[[Device](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-configs.html#qairt.api.configs.device.Device)] = None*, *\**, *backend\_extensions\_config: Optional[Dict] = None*, *qairt\_sdk\_root: Optional[Union[str, PathLike]] = None*, *clean\_up: bool = True*, *draft\_models: Optional[List[[CompiledModel](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-core-api.html#qairt.CompiledModel)]] = None*, *draft\_model\_backend\_extensions\_config: Optional[Dict] = None*)

    - Bases: [`GenAIExecutable`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-api-executors.html#qairt.gen_ai_api.executors.gen_ai_executable.GenAIExecutable)

The T2TExecutor handles text-to-text generation on target via Genie. It supports two modes of execution:

- Native: This is the default mode of execution on platforms with native python support if no device is
specified. Execution is performed via native python bindings.
- Device: This is the mode of execution when a device is specified. Execution is performed via subprocess.
See [`qairt.api.configs.device.Device`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-configs.html#qairt.api.configs.device.Device) for supported device types.

The appropriate runner is selected automatically by `GenieRunnerFactory` based on the device
configuration.  Both modes are accessed through the unified `GenieRunner` interface.

- clean\_environment() → Self

    - Removes artifacts from target environment

- generate(*prompt: GenerationRequest*) → TextGenerationResult

- generate(*prompt: Union[str, List[Dict[str, str]], Path]*, *\**, *lora\_config: Optional[[UseCaseRunConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-gen-ai-modules-lora.html#qairt.modules.lora.lora_config.UseCaseRunConfig)] = None*) → TextGenerationResult

    - Executes a generation request.

Concrete executors should return a subclass of <cite>GenerationExecutionResult</cite>
(e.g., <cite>TextGenerationResult</cite>, <cite>ImageGenerationResult</cite>).

- Parameters

    - **prompt** – The generation request containing the input messages.

- Returns

    - A <cite>GenerationExecutionResult</cite> (or subclass) with the generation
output.

- prepare\_environment() → Self

    - Prepares artifacts for execution on target

- stream\_generate(*prompt: Union[str, List[Dict[str, str]], Path]*, *streamer: Queue*) → Task

    - Starts streaming generation and returns the task that will produce the final result.

- Parameters

    - - **prompt** (*Union* *[* *str* *,* *List* *[* *Dict* *[* *str* *,* *str* *]* *]* *,* *Path* *]*) –

    The prompt to be used for generation.
Can be one of:

    - str: A raw text string prompt
    - Path: Path to a JSON file containing chat messages
    - List[Dict[str, str]]: A list of dicts with “role” and “content” keys. Each dict should contain:

        - ”role”: The role of the message sender (e.g., “system”, “user”, “assistant”)
        - ”content”: The actual message content
- **streamer** (*asyncio.Queue*) – An asyncio queue used to stream output chunks back to the caller.

- Returns

    - A task that will eventually return TextGenerationResult.

- Return type

    - asyncio.Task

- Raises

    - **NotImplementedError** – If the active runner does not support streaming (i.e. it is not a
    `StreamableGenieRunner`).

Last Published: May 26, 2026

[Previous Topic
GenAIContainer](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-gen-ai-api-containers.md) [Next Topic
BuilderTransformerConfig](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-gen-ai-api-configs.md)