Infrastructure as code
Define the desired service. Infimal translates your source into its deployment specification.
The App declaration
An App names one deployable service. Its declaration holds the durable infrastructure configuration; decorators supply the initialization and execution functions. Keep the file in version control so changes can be reviewed alongside the model.
Python
from infimal import App, Endpoint, Scale, Batch app = App( "asr-emotion-checkpoint4200", endpoint=Endpoint(public=False), scale=Scale(min_replicas=0, max_replicas=1000), batch=Batch(max_size=16, window_ms=20),)Core configuration
| Field | Meaning | Default |
|---|---|---|
| name | Stable application name | Required |
| endpoint | Exposure, protocol, and path | Public HTTP at / |
| scale | Replica bounds and residency policy | 0–1 replicas |
| batch | Size, waiting window, and shape bucket | One request; no waiting |
| labels | String metadata for your application | {} |
| region | Placement region, when supported | Environment selection |
From source to specification
Loading the Python module produces an App with a validated Deployment. Deployment.to_wire() serializes the declaration into the JSON understood by the control plane. The plan compares desired state with deployed state.
This is infrastructure as code: the Python file is an interface to a model service specification. Python syntax is not the product boundary, and the declaration does not select a GPU SKU.
Validation before deployment
- Define exactly one setup function per App.
- Define a handler or stream function that accepts the setup state.
- Keep max_replicas at least 1 and at least min_replicas.
- Use max_size of at least 1 and a nonnegative batching window.