# Develop a generative AI (GenAI) application: GenAI Studio
GenAI Studio is a containerized solution to enable rapid prototyping and customization
by simplifying the creation and deployment of Generative AI applications on Qualcomm Linux
systems. GenAI Studio has applications for text generation, text-to-speech, image generation,
and speech-to-text.
All applications are accessible through a web interface.
Note
- GenAI Studio doesn’t include model files or container images.
- You must generate the models and build container images.
- Ensure your host computer meets the [requirements](https://github.com/quic/ai-hub-apps/tree/main/tutorials/llm_on_genie).
- To build the docker containers:
- Ubuntu for Qualcomm IoT solutions: Use the target device or host computer
- Qualcomm Linux: Use the host computer
| Use case | Description | Supported platforms | Model(s) |
| --- | --- | --- | --- |
| Text-to-Text | Generates human-like responses with LLM for input prompts. Useful for creating articles, summaries, reports, or creative content automatically. |
IQ9 Qualcomm Linux
IQ9 Qualcomm Ubuntu
| LLaMA 3.2-3B |
| Text-to-Speech | Transforms text into clear, natural-sounding audio. Ideal for voice assistants, audiobooks, and accessibility solutions. |
IQ9 Qualcomm Linux
IQ9 Qualcomm Ubuntu
| Melo-TTS |
| Text-to-Image | Generates images from text descriptions. Ideal for creating graphics, illustrations, or visual content without manual design. |
IQ9 Qualcomm Linux
IQ9 Qualcomm Ubuntu
| Stable Diffusion |
| Speech-to-Text | Turns spoken words into written text. Helpful for transcription, voice commands, and hands-free applications. |
IQ9 Qualcomm Linux
IQ9 Qualcomm Ubuntu
| Whisper Base |
| Web-UI | Provides an easy-to-use web interface to access all these features in one place, making it simple for developers and users. |
IQ9 Qualcomm Linux
IQ9 Qualcomm Ubuntu
| All models listed above |
## High-level architecture
The following diagram shows the high-level architecture of GenAI Studio, including the available use cases
(each use case is a containerized solution), their backend component interaction, and the endpoints exposed
by GenAI Studio services.

## High-level call flow
The following call flow shows each GenAI Studio use case, including the components of the solution and its
interaction with other components of the system.
Note
Each endpoint has a specific port. Please note the port number in [endpoint port numbers](https://docs.qualcomm.com/doc/80-70023-15B/topic/develop-genai-app-with-genai-studio.html#tbl-endpoint-ports).

The following table lists each endpoint and its associated port number.
Endpoint port numbers
| Endpoint | Port number |
| --- | --- |
| asr | 8081 |
| text2image | 8082 |
| text2text | 8088 |
| text2speech | 8083 |
### User interaction
The user accesses GenAI Studio through a web page hosted on the host computer and initiates
all interactions (text, image, or audio uploads) from this frontend.
### Request routing to target
The webpage communicates with the web UI service running on the target device (for example
Qualcomm Dragonwing™ IQ9) and converts each user action on the UI into a corresponding REST
API call to the web UI backend.
### Web UI orchestration layer
The web UI container acts as the central orchestrator. It receives REST requests from the web page,
aggregates responses, and sends them back to the web frontend.
Containerized architecture and scalability
Each functional block (ASR, web UI, text-to-text, text-to-image) runs as an independent container.
This provides the following:
- Isolation between services.
- Scalability, since each service scales independently based on use case.
- Extensibility, since you can add new modalities or models as additional containers
and expose the using REST.
See the documentation of each respective use case, for more detailed information.
### Web-UI (unified frontend)
The web-UI is a browser-based interface that unifies all GenAI Studio services
(text-to-text, text-to-speech, text-to-image, ASR) behind panels.
It communicates with the individual REST endpoints and supports the following:
- Token streaming for chat and progress updates for image/audio generation.
- Session handling, prompt history, system-prompt controls, and sampler parameter inputs.
- Visualized outputs, like chat transcripts, audio players for text-to-speech, image galleries for diffusion results, and ASR transcripts.
- Basic error feedback and recovery.
- API timing logs in the console.
- Containerized deployment that typically runs alongside each service container.
- Environment and configuration binding to host ports on Dragonwing products.
- Multi-turn chat with KV-cache continuity and optional role templates (LLAMA formats).
- Extensibility for demos like ASR > LLM > text-to-speech pipelines and document summarization.
- Surface to validate models, parameters, and device backends.
See the [high-level call flow](https://docs.qualcomm.com/doc/80-70023-15B/topic/develop-genai-app-with-genai-studio.html#fig-genai-studio-call-flow) for details about web-UI functionality
and its interaction with other components in the system.
### Text-to-text
This application runs a text-to-text large language model (LLM) on IQ9 Qualcomm Ubuntu or Linux using the
Genie API. It provides a persistent (always-on) LLM server that supports the following:
- LLM response generation from user prompts (text-to-text).
- Preloaded model reuse to avoid reloading for each request.
- Control endpoints for model/session reset and model reload.
- System prompt updates directly from the UI.
- Conversation history that allows the UI to fetch previous messages.
### Text generation call flow

### Model reset call flow

### Model reload call flow

### Text-to-image
The following image shows an example call flow sequence in a text-to-image container.

1. The user requests image generation through a text prompt.
2. The web UI forwards the prompt to the text-to-image container through a REST API call.
3. The text-to-image service generates one or more images.
4. The web UI returns the generated images to the web page for rendering.
5. The UI renders the generated image(s).
### Text-to-speech
The following image shows an example call flow sequence in a text-to-speech container

1. The user enters a prompt to be spoken out loud.
2. The web UI sends the text to the text-to-speech container through a REST API call.
3. The text-to-speech service performs speech synthesis and returns an audio stream.
4. The text-to-speech passes this audio back to the web page.
5. Web UI: The web front end plays the synthesized speech to the user through the browser.
### Speech-to-text
The following image shows an example call flow sequence in a speech-to-text container.

1. The user provides audio input.
2. The web UI sends the audio payload to the ASR container through a REST API call.
3. The ASR service performs automatic speech recognition and returns the transcribed text.
4. Once complete, the web UI displays the text directly or forwards it to the text-to-text backend for
further generation.
## Setup GenAI Studio
GenAI Studio is supported on IQ9 with both Qualcomm Linux distributions and Ubuntu on Qualcomm IoT platforms.
The primary setup difference is that target devices running Ubuntu distributions can be used as the host computer
to build container images, without the need for a separate host computer. Target devices running Qualcomm Linux
(yocto) distribution require a separate host computer to build container images.
Note
Language models aren’t shipped with GenAI Studio. You must [generate a model using AI Hub](https://docs.qualcomm.com/doc/80-70023-15B/topic/genai-prepare-ai-hub.html).
Tab Qualcomm Linux
Tab Ubuntu
1. On the host computer, download the precompiled Qualcomm Linux build image for your EVK from [codelinaro](https://artifacts.codelinaro.org/ui/native/qli-ci/flashable-binaries/qimpsdk/).
2. From the host computer, [Flash the image](https://docs.qualcomm.com/doc/80-70023-254/topic/flash_images.html) to the target device.
Note
On QLI, Qualcomm-dependent DSP libraries and Docker are pre-installed.
3. On the host computer, set up the `arm64_qemu` docker driver.
This provides QEMU emulation binaries to allow running containers built for different CPU architectures on a
host with another architecture (x86\_64).
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Copy to clipboard
docker buildx rm builder
Copy to clipboard
docker buildx create --name builder --driver docker-container --use
Copy to clipboard
docker buildx inspect --bootstrap
Copy to clipboard
4. On the host computer, build the use case container images.
The time taken to generate container images depends on network bandwidth and can take
more than 30 minutes for each use case container.
1. Clone the source code.
git clone https://github.com/quic/sample-apps-for-qualcomm-linux.git
Copy to clipboard
cd sample-apps-for-qualcomm-linux/GenAI-Solutions/GenAI-Studio
Copy to clipboard
2. Build the `speech-to-text` container.
cd Speech-To-Text
Copy to clipboard
docker build --progress=plain --platform=linux/arm64/v8 -t asr .
Copy to clipboard
docker save -o asr.tar asr
Copy to clipboard
cd ..
Copy to clipboard
3. Build the `text-to-text` container.
cd Text-Generation
Copy to clipboard
docker build --progress=plain --platform=linux/arm64/v8 -t text2text .
Copy to clipboard
docker save -o text2text.tar text2text
Copy to clipboard
cd ..
Copy to clipboard
4. Build the `text-to-speech` container.
cd Text-To-Speech/meloTTS
Copy to clipboard
docker build --progress=plain --platform=linux/arm64/v8 -t text2speech .
Copy to clipboard
docker save -o text2speech.tar text2speech
Copy to clipboard
cd ../../
Copy to clipboard
5. Build the `text-to-image` container.
cd Image-Generation
Copy to clipboard
docker build --progress=plain --platform=linux/arm64/v8 -t text2image .
Copy to clipboard
docker save -o text2image.tar text2image
Copy to clipboard
cd ..
Copy to clipboard
6. Build the `web-ui` container.
cd web-ui
Copy to clipboard
docker build --progress=plain --platform=linux/arm64/v8 -t web-ui .
Copy to clipboard
docker save -o web-ui.tar web-ui
Copy to clipboard
cd ..
Copy to clipboard
5. From the host computer, push the generated container images to the target device.
1. Connect to the network and set up UART and Wi-Fi. See [connect to the network](https://docs.qualcomm.com/doc/80-70023-254/topic/how_to.html#connect-to-the-network)
for detailed instructions.
2. [Get the IP address](https://docs.qualcomm.com/doc/80-70023-254/topic/how_to.html#setup) of the target device.
3. Connect to the target device using the IP address and push the container images to the target device.
scp -r Speech-To-Text/asr Text-Generation/text2text Text-To-Speech/meloTTS/text2speech Image-Generation/text2image web-ui/web-ui root@:/opt/
Copy to clipboard
Note
If needed, the default password for Qualcomm Linux is `oelinux123`
6. On the target device, load the containers.
docker load -i /opt/asr.tar
Copy to clipboard
docker load -i /opt/text2text.tar
Copy to clipboard
docker load -i /opt/text2speech.tar
Copy to clipboard
docker load -i /opt/text2image.tar
Copy to clipboard
docker load -i /opt/web-ui.tar
Copy to clipboard
1. Connect to the network and set up UART and Wi-Fi.
For detailed instructions,
see [verify reboot and sign in](https://docs.qualcomm.com/doc/80-90441-252/topic/Use-Ubuntu-on-iq9.html#verify-reboot-and-sign-in-to-the-dragonwing-iq-9075-evk-ubuntu-console).
2. [Flash the Ubuntu build](https://docs.qualcomm.com/doc/80-90441-252/topic/Integrate-and-flash-software.html) to the target device.
3. Install necessary Qualcomm personal package archives (PPAs).
sudo add-apt-repository ppa:ubuntu-qcom-iot/qcom-ppa
Copy to clipboard
sudo apt update
Copy to clipboard
This adds the Qualcomm IoT PPA repository, which provides the necessary packages and updates.
4. Install the required Qualcomm libraries and tools to access Qualcomm hardware.
sudo apt install -y qcom-fastrpc1 qcom-libdmabufheap-dev qcom-fastrpc-dev qcom-dspservices-headers-dev libqnn1 qnn-tools libsnpe1 snpe-tools qcom-property-vault gstreamer1.0-plugins-qcom-mlmetaparser gstreamer1.0-plugins-qcom-mlvpose
Copy to clipboard
5. Set up the container device interface (CDI). The CDI interface provides an interface that allows containers
to access Qualcomm DSP and GPU hardware resources.
curl -L -O https://git.codelinaro.org/clo/le/sdk-tools/-/raw/imsdk-tools.lnx.1.0.r1-rel/qimsdk-ubuntu/scripts/generate_cdi_json.sh?ref_type=heads&inline=false
Copy to clipboard
6. Install CDI dependencies.
bash generate_cdi_json.sh
Copy to clipboard
7. Verify the installed CDI file.
ls /etc/cdi/docker-run-cdi-hw-acc.json
Copy to clipboard
8. Replace the `/etc/cdi/docker-run-cdi-hw-acc.json` with `docker-run-cdi-hw-acc.json`
from [quic/sample-apps-for-qualcomm-linux · GitHub](https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/GenAI-Solutions/GenAI-Studio/docker-run-cdi-hw-acc.json)
9. Modify permissions for the `/opt/` folder to access artifacts.
sudo chown -R ubuntu:ubuntu /opt/
Copy to clipboard
10. Validate the NPU runtime.
snpe-platform-validator --runtime dsp
Copy to clipboard
The following snippet shows an example of the expected output.
PF_VALIDATOR: DEBUG: Checking if backend is available
PF_VALIDATOR: DEBUG: Snpe-QNN HTP backend deviceId 0 initialization successful
PF_VALIDATOR: DEBUG: Checking if backend is available
PF_VALIDATOR: DEBUG: Snpe-QNN HTP backend deviceId 1 initialization successful
PF_VALIDATOR: DEBUG: starting calculator test
PF_VALIDATOR: DEBUG: Loading HTP stub: libSnpeHttpV73CalculatorStub.so
PF_VALIDATOR: DEBUG: Successfully loaded DSP library - 'libSnpeHttpV73CalculatorStub.so'. Setting up pointers.
PF_VALIDATOR: DEBUG: Success in executing the sum function
Unit Test on the runtime DSP: Passed.
SNPE is supported for runtime DSP on the device.
Copy to clipboard
`runtime DSP: Passed` ensures that the DSP runtime is supported on the device.
11. Install Docker and its dependencies.
1. Update the package index.
sudo apt-get update
Copy to clipboard
2. Install the required packages.
sudo apt-get install -y ca-certificates curl gnupg lsb-release
Copy to clipboard
3. Add the official GPG key for Docker.
sudo mkdir -p /etc/apt/keyrings
Copy to clipboard
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Copy to clipboard
4. Set up the Docker repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Copy to clipboard
5. Update package index
sudo apt-get update
Copy to clipboard
6. Install the Docker engine.
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose
Copy to clipboard
7. Add your user to the Docker group (to run `docker` without `sudo`)
sudo usermod -aG docker $USER
Copy to clipboard
newgrp docker
Copy to clipboard
>
>
> 1. Create an `/etc/docker` directory for Docker daemon configuration.
>
>
> mkdir -p /etc/docker/
> Copy to clipboard
> 2. Add or update content in `/etc/docker/daemon.json` to add CDI support.
>
>
> {
> "features": {
> "cdi": true
> }
> }
> Copy to clipboard
> 3. Restart the Docker service to enable CDI support.
>
>
> sudo systemctl restart docker
> Copy to clipboard
12. Build the container images.
The time taken to generate container images depends on the network connection speed and
can take more than 30 minutes for each container image.
1. Clone the source code from Github
git clone https://github.com/quic/sample-apps-for-qualcomm-linux.git
Copy to clipboard
cd sample-apps-for-qualcomm-linux/GenAI-Solutions/GenAI-Studio
Copy to clipboard
2. Generate the speech-to-text container.
cd Speech-To-Text
Copy to clipboard
docker build --progress=plain -t asr .
Copy to clipboard
docker save -o asr asr
Copy to clipboard
cd ..
Copy to clipboard
3. Generate the text-to-text container.
cd Text-Generation
Copy to clipboard
docker build --progress=plain -t text2text .
Copy to clipboard
docker save text2text -o text2text
Copy to clipboard
cd ..
Copy to clipboard
4. Generate the text-to-speech container.
cd Text-To-Speech/meloTTS/
Copy to clipboard
docker build --progress=plain -t text2speech .
Copy to clipboard
docker save text2speech -o text2speech
Copy to clipboard
cd ..
Copy to clipboard
5. Generate text-to-image container
cd Image-Generation
Copy to clipboard
docker build --progress=plain -t text2image .
Copy to clipboard
docker save text2image -o text2image
Copy to clipboard
cd ..
Copy to clipboard
6. Generate web-ui container
cd web-ui
Copy to clipboard
docker build --progress=plain -t web-ui .
Copy to clipboard
docker save web-ui -o web-ui
Copy to clipboard
cd ..
Copy to clipboard
13. Load the container images.
docker load -i Speech-To-Text/asr
Copy to clipboard
docker load -i Text-Generation/text2text
Copy to clipboard
docker load -i Text-To-Speech/text2speech
Copy to clipboard
docker load -i Image-Generation/text2image
Copy to clipboard
docker load -i web-ui/web-ui
Copy to clipboard
## Generate model binaries
The text-to-image and speech-to-text models are directly downloaded from AI Hub.
The text-to-speech and text-to-text models need to be built using the following steps and then
copied to the target device.
### Generate language model binaries
Follow these steps to generate language model binaries needed to run GenAI Studio containers.
Run these commands on the host computer.
1. [Generate the language model binaries](https://github.com/quic/ai-hub-apps/tree/main/tutorials/llm_on_genie).
2. Export the model.
Note
The export command may take 2-3 hours and requires significant memory (RAM + swap) on the host computer.
python -m qai_hub_models.models.llama_v3_8b_instruct.export --chipset qualcomm-snapdragon-x-elite --skip-inferencing --skip-profiling --output-dir genie_bundle
Copy to clipboard
3. [Get the IP address](https://docs.qualcomm.com/doc/80-70023-254/topic/how_to.html?#setup) of the target device.
4. Connect to the target device using the IP address.
5. Copy model binaries to the target device.
Tab Qualcomm Linux
Tab Ubuntu
scp -r genie_bundle root@:/opt/
Copy to clipboard
Note
If needed, the default password for Qualcomm Linux is: `oelinux123`.
scp -r genie_bundle ubuntu@:/opt/
Copy to clipboard
### Generate text-to-speech model binaries
1. Since text-to-speech models aren’t distributed, install [VoiceAI TTS](https://qpm.qualcomm.com/#/main/tools/details/VoiceAI_TTS)
and follow the instructions in *VoiceAI\_TTS/1.0.1.0/notebook/melo/npu/README.md* to generate models.
2. Add the following commands to the `Melo-Notebook.ipynb` Jupyter notebook to generate `qnn_ctx` Onnx models.
wget https://raw.githubusercontent.com/microsoft/onnxruntime/main/onnxruntime/python/tools/qnn/gen_qnn_ctx_onnx_model.py
for file_name in os.listdir(output_path):
print(f"\nfile_name : {file_name} \n")
net_json_file = file_name.replace("_htp.bin",'_net.json')
if file_name=='fbert_htp.bin':net_json_file = 'bert_net.json'
full_path_json_file = os.path.join(intermediates_path, net_json_file)
print(full_path_json_file)
!python gen_qnn_ctx_onnx_model.py -b {os.path.join(output_path,file_name)} -q {os.path.join(intermediates_path,net_json_file)}
Copy to clipboard
3. [Get the IP address](https://docs.qualcomm.com/doc/80-70023-254/topic/how_to.html#setup) of the target device.
4. Push models to `/opt/TTS_models/` on the target device.
Tab Qualcomm Linux
Tab Ubuntu
scp -r TTS_models root@:/opt/
Copy to clipboard
Note
If needed, the default password is: `oelinux123`.
scp -r TTS_models ubuntu@:/opt/
Copy to clipboard
## Run GenAI Studio containers
1. On the target device, run the following commands to start the GenAI Studio containers.
git clone https://github.com/quic/sample-apps-for-qualcomm-linux.git
Copy to clipboard
cd sample-apps-for-qualcomm-linux/GenAI-Solutions/GenAI-Studio
Copy to clipboard
2. Start GenAI Studio.
docker-compose -f docker-compose.yml up -d
Copy to clipboard
ubuntu@ubuntu:~$ docker-compose -f docker-compose.yml up -d
Creating Text2Image ... done
Creating TTS ... done
Creating ASR ... done
Creating web-ui ... done
Creating Text2Text ... done
Copy to clipboard
The following snippet shows an example of the expected output.
Notes
- If you face the `CDI device injection failed: failed to inject devices: failed to stat CDI host device "/dev/kgsl-3d0": no such file or directory` error,
remove `/dev/kgsl-3d0` from `/etc/cdi/docker-run-cdi-hw-acc.json`.
{
"path": "/dev/kgsl-3d0"
},
Copy to clipboard
- For errors related to Docker, use the docker-run-cdi-hw-acc.json <https://github.com/quic/sample-apps-for-qualcomm-linux/blob/main/GenAI-Solutions/GenAI-Studio/docker-run-cdi-hw-acc.json>
configuration file directly from the repository.
- To view the application on the host computer (For Ubuntu builds, the host and target machines are the same), run the following command.
docker logs -f web-ui
Copy to clipboard
The following snippet shows an example of the expected output.
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.0.4:8501
Click on http://192.168.0.4:8501 to open webpage
Copy to clipboard
- Stop GenAI Studio.
docker-compose -f docker-compose.yml down
Copy to clipboard
The following snippet shows an example of the expected output.
ubuntu@ubuntu:~$ docker-compose -f docker-compose.yml down
Stopping Text2Image ... done
Stopping TTS ... done
Stopping Text2Text ... done
Stopping web-ui ... done
Stopping ASR ... done
Removing Text2Image ... done
Removing TTS ... done
Removing Text2Text ... done
Removing web-ui ... done
Removing ASR ... done
Copy to clipboard
Last Published: Dec 29, 2025
[Previous Topic
Develop a generative AI (GenAI) application](https://docs.qualcomm.com/bundle/publicresource/80-70023-15B/topics/develop-genai-app.md) [Next Topic
Troubleshooting and FAQ](https://docs.qualcomm.com/bundle/publicresource/80-70023-15B/topics/troubleshooting-and-faq.md)