Skip to main content

Classes

App

Create a fal serverless application. Subclass this to define your application with custom setup, endpoints, and configuration. The App class handles model loading, request routing, and lifecycle management. Example:
Inherits from: BaseServable

Constructor Parameters

Class Variables

Properties

Methods

collect_routes

Returns: dict[RouteSignature, Callable[Ellipsis, Any]]

get_endpoints

Returns: list[str]

get_health_check_config

Returns: Optional[ApplicationHealthCheckConfig]

handle_exit

Handle exit signal.

health

lifespan

provide_hints

Provide hints for routing the application.Returns: list[str]

run_local

setup

Setup the application before serving.

spawn

Returns: AppSpawnInfo

teardown

Teardown the application after serving.

HealthCheck

Constructor Parameters

Class Variables

FalServerlessKeyCredentials

Inherits from: Credentials

Constructor Parameters

Class Variables

Methods

to_grpc

Returns: ChannelCredentials

to_headers

Returns: dict[str, str]

ContainerImage

ContainerImage represents a Docker image that can be built from a Dockerfile.

Constructor Parameters

Class Variables

Methods

add_dockerignore

Add or update dockerignore patterns. Sets the internal dockerignore patterns using gitignore-style matching. You can provide either a list of patterns or a path to a .dockerignore file.Returns: NoneTypeRaises:
  • ValueError: If both patterns and path are provided, or neither

from_dockerfile

Returns: ContainerImage

from_dockerfile_str

Returns: ContainerImage

get_copy_add_sources

Get list of src paths/patterns from COPY/ADD commands. This method only parses the Dockerfile - it doesn’t access the filesystem.Returns: list[str]

to_dict

Returns: dict

Functions

function

cached

Cache the result of the given function in-memory. Returns: Callable[ArgsT, ReturnT]

endpoint

Designate the decorated function as an application endpoint. Returns: Callable[EndpointT, EndpointT]

realtime

Designate the decorated function as a realtime application endpoint. Returns: Callable[EndpointT, EndpointT]

sync_dir

Returns: str