Docs/Build

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

FieldMeaningDefault
nameStable application nameRequired
endpointExposure, protocol, and pathPublic HTTP at /
scaleReplica bounds and residency policy0–1 replicas
batchSize, waiting window, and shape bucketOne request; no waiting
labelsString metadata for your application{}
regionPlacement region, when supportedEnvironment 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.