# Build apps

> **📝 Note**
>
> An LLM-optimized bundle of this entire section is available at [`section.md`](https://www.union.ai/docs/v2/union/user-guide/build-apps/section.md).
> This single file contains all pages in this section, optimized for AI coding agent context.

This section covers how to build different types of apps with Flyte, including Streamlit dashboards, FastAPI REST APIs, vLLM and SGLang model servers, webhooks, and WebSocket applications.

> [!TIP]
> Go to [Introducing apps](https://www.union.ai/docs/v2/union/user-guide/core-concepts/introducing-apps/page.md) for an overview of apps and a quick example.

## App types

Flyte supports various types of apps:

- **UI dashboard apps**: Interactive web dashboards and data visualization tools like Streamlit and Gradio
- **Web API apps**: REST APIs, webhooks, and backend services like FastAPI and Flask
- **Model serving apps**: High-performance LLM serving with vLLM and SGLang

## Next steps

- [**Single-script apps**](https://www.union.ai/docs/v2/union/user-guide/build-apps/single-script-apps/page.md): The simplest way to build and deploy apps in a single Python script
- [**Multi-script apps**](https://www.union.ai/docs/v2/union/user-guide/build-apps/multi-script-apps/page.md): Build FastAPI and Streamlit apps with multiple files
- [**App usage patterns**](https://www.union.ai/docs/v2/union/user-guide/build-apps/app-usage-patterns/page.md): Call apps from tasks, tasks from apps, and apps from apps
- [**Secret-based authentication**](https://www.union.ai/docs/v2/union/user-guide/build-apps/secret-based-authentication/page.md): Authenticate FastAPI apps using Flyte secrets
- [**Streamlit app**](https://www.union.ai/docs/v2/union/user-guide/build-apps/streamlit-app/page.md): Build interactive Streamlit dashboards
- [**FastAPI app**](https://www.union.ai/docs/v2/union/user-guide/build-apps/fastapi-app/page.md): Create REST APIs and backend services
- [**vLLM app**](https://www.union.ai/docs/v2/union/user-guide/build-apps/vllm-app/page.md): Serve large language models with vLLM
- [**SGLang app**](https://www.union.ai/docs/v2/union/user-guide/build-apps/sglang-app/page.md): Serve LLMs with SGLang for structured generation

## Subpages

- [Single-script apps](https://www.union.ai/docs/v2/union/user-guide/build-apps/single-script-apps/page.md)
  - Plain Python HTTP server
  - Streamlit app
  - FastAPI app
  - Running single-script apps
  - When to use single-script apps
- [Multi-script apps](https://www.union.ai/docs/v2/union/user-guide/build-apps/multi-script-apps/page.md)
  - FastAPI multi-script app
  - Project structure
  - Example: Multi-file FastAPI app
  - Automatic file discovery
  - Streamlit multi-script app
  - Project structure
  - Example: Multi-file Streamlit app
  - Deploying multi-file Streamlit app
  - Complex multi-file example
  - Project structure
  - Example code
  - Deploying complex app
  - Best practices
  - Troubleshooting
- [App usage patterns](https://www.union.ai/docs/v2/union/user-guide/build-apps/app-usage-patterns/page.md)
  - Patterns overview
  - Call app from task
  - Example: Task calling an app
  - Call task from app (webhooks / APIs)
  - Example: Basic webhook app
  - Advanced webhook patterns
  - Webhook security and best practices
  - Example: GitHub webhook
  - Gradio agent UI
  - Call app from app
  - Example: App calling another app
  - Using AppEndpoint parameter
  - WebSocket-based patterns
  - Example: Basic WebSocket app
  - WebSocket patterns
  - Using WebSockets with Flyte tasks
  - WebSocket client example
  - Browser-based apps
  - Best practices
  - Summary
- [Secret-based authentication](https://www.union.ai/docs/v2/union/user-guide/build-apps/secret-based-authentication/page.md)
  - Create the secret
  - Define the FastAPI app
  - Deploy the FastAPI app
  - Invoke the endpoint
  - Authentication for vLLM and SGLang apps
  - Create the authentication secret
  - Deploy vLLM app with authentication
  - Deploy SGLang app with authentication
  - Invoke authenticated LLM endpoints
  - Accessing Swagger documentation
  - Security best practices
  - Troubleshooting
  - Next steps
- [Streamlit app](https://www.union.ai/docs/v2/union/user-guide/build-apps/streamlit-app/page.md)
  - Basic Streamlit app
  - Single-file Streamlit app
  - Multi-file Streamlit app
  - Example: Data visualization dashboard
  - Best practices
  - Troubleshooting
- [FastAPI app](https://www.union.ai/docs/v2/union/user-guide/build-apps/fastapi-app/page.md)
  - Basic FastAPI app
  - Serving a machine learning model
  - Accessing Swagger documentation
  - Example: REST API with multiple endpoints
  - Multi-file FastAPI app
  - Local-to-remote model serving
  - Best practices
  - Advanced features
  - Troubleshooting
- [vLLM app](https://www.union.ai/docs/v2/union/user-guide/build-apps/vllm-app/page.md)
  - Installation
  - Basic vLLM app
  - Using prefetched models
  - Model streaming
  - Custom vLLM arguments
  - Using the OpenAI-compatible API
  - Multi-GPU inference (Tensor Parallelism)
  - Model sharding with prefetch
  - Autoscaling
  - Best practices
  - Troubleshooting
- [SGLang app](https://www.union.ai/docs/v2/union/user-guide/build-apps/sglang-app/page.md)
  - Installation
  - Basic SGLang app
  - Using prefetched models
  - Model streaming
  - Custom SGLang arguments
  - Using the OpenAI-compatible API
  - Multi-GPU inference (Tensor Parallelism)
  - Model sharding with prefetch
  - Autoscaling
  - Structured generation
  - Best practices
  - Troubleshooting

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/user-guide/build-apps/_index.md
**HTML**: https://www.union.ai/docs/v2/union/user-guide/build-apps/
