Docs/Start here

Deploy your first model

Define the infrastructure, initialize your model, and expose a handler in one source file.

Before you start

Use Python 3.11 or later and install the SDK from the Infimal repository. You also need your own model loading and inference code. For remote deployment, configure an endpoint and an API key for a provisioned Infimal environment.

Terminal / reference
python -m pip install ./sdk
python -m infimal --help

Create asr-emotion-checkpoint4200.py

Save this file in your model project. Replace my_model with your own module. Its load_model function must return an object that can handle the audio payload. Keep reusable model initialization inside setup.

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),) @app.setupdef load():    from my_model import load_model    return load_model() @app.handlerdef transcribe(model, request):    return model(request["audio"])

Review the plan

Run from the directory containing asr-emotion-checkpoint4200.py. The CLI imports the module, validates the App, and compares the declaration with the configured environment. Review the plan before changing infrastructure. Module imports must be safe to run during planning.

Terminal / reference
python -m infimal plan asr-emotion-checkpoint4200

Build and deploy

Deploy runs the build and placement flow for the application. The builder initializes the model and publishes a snapshot. Inspect status and build logs to confirm the outcome; a submitted command is not proof of a healthy service.

Terminal / reference
python -m infimal deploy asr-emotion-checkpoint4200
infimal apps status asr-emotion-checkpoint4200
infimal apps logs asr-emotion-checkpoint4200 --limit 50

Change the definition

Change access, batching, or scale bounds in your source. Plan again, then apply. The CLI distinguishes changes that need a new build from those that can update the running configuration.

Terminal / reference
python -m infimal plan asr-emotion-checkpoint4200
python -m infimal apply asr-emotion-checkpoint4200