Basic Usage
Configuration Options
You can configure your app using class variables or thehost_kwargs
dictionary for advanced options.
Environment Configuration
requirements
(list[str])
List of pip packages to install in the environment.
local_python_modules
(list[str])
List of local Python module names to include in the deployment.
Machine Configuration
machine_type
(str | list[str])
Hardware type(s) to use. Can be a single type or a list of types in order of preference.
CPU Machines:
"XS"
- 0.50 CPU cores, 512MB RAM"S"
- 1 CPU core, 1GB RAM (default)"M"
- 2 CPU cores, 2GB RAM"L"
- 4 CPU cores, 15GB RAM
"GPU-A100"
- 12 CPU cores, 60GB RAM, 1 GPU core (40GB VRAM)"GPU-H100"
- 12 CPU cores, 112GB RAM, 1 GPU core (80GB VRAM)"GPU-H200"
- 12 CPU cores, 112GB RAM, 1 GPU core (141GB VRAM)"GPU-B200"
- 24 CPU cores, 112GB RAM, 1 GPU core (192GB VRAM)
num_gpus
(int)
Number of GPUs required for the application.
Timeout Configuration
request_timeout
(int)
Maximum time in seconds for a single request to complete.
startup_timeout
(int)
Maximum time in seconds for the environment to start up.
Authentication
app_auth
(str)
Authentication mode for the application.
Options:
"private"
: Only accessible with your API key"public"
: Accessible without authentication"shared"
: Accessible with any valid fal API keyNone
: Inherit from deployment command
App Metadata
app_name
(str)
Custom name for the application. Auto-generated from class name if not specified.
Scaling Configuration
Control how your application scales to handle traffic. These options help balance performance and cost.keep_alive
(int)
Time in seconds to keep idle runners alive. Default: 10 seconds.
min_concurrency
(int)
Minimum number of runners to keep running at all times. Default: 0.
max_concurrency
(int)
Maximum number of runners that can be created. Default: 10.
concurrency_buffer
(int)
Number of extra runners to provision beyond current demand. Default: 0.
max_multiplexing
(int)
Maximum number of requests a single runner can handle concurrently. Default: 1.
Note:See the Scaling Guide for detailed explanations and examples of these options.
Complete Example
Here’s a comprehensive example showing all common configuration options:See Also
- Getting Started Guide - Quick introduction to building your first app
- Deployment Operations - Production deployment best practices
- Scaling Guide - Detailed scaling configuration