How to Deploy a Model
Deploying a model on InfraMind involves preparing a self-contained execution environment, defining its runtime behavior in a manifest, publishing it to decentralized storage, and registering it with the protocol so that jobs can be routed to eligible nodes. The process is deterministic and reproducible, allowing models to be executed identically across hundreds or thousands of mesh nodes with no configuration drift.
This section outlines the standard deployment process using the CLI (infra), but each step can also be done manually using Docker, IPFS, and curl.
Step 1: Containerize the Model
Start by creating a directory for the model container:
mkdir summarizer-v1 && cd summarizer-v1Add your model serving script (e.g. serve.py) and requirements.txt:
# serve.py
from fastapi import FastAPI, Request
import uvicorn
app = FastAPI()
@app.post("/inference")
async def infer(req: Request):
data = await req.json()
input_text = data.get("text")
summary = input_text[:64] + "..." # Stub summarization
return {"summary": summary}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=9000)Write the Dockerfile:
Build the container:
Export it to a tarball:
Step 2: Write model.yaml
This manifest defines the model's runtime behavior, input/output schema, and resource requirements. Create a file model.yaml:
InfraMind nodes use this file to validate input payloads, configure container limits, and expose the endpoint schema for automated documentation.
Step 3: Push to IPFS or Registry
Package the model directory for upload:
Upload to IPFS:
Output:
Take the CID of the directory (QmYuv...) as the canonical reference.
Alternatively, publish to the InfraMind-hosted registry:
The CLI will push the image to the default storage backend and return the container hash.
Step 4: Register Endpoint
Once the image is hosted and the manifest is validated, register it to the InfraMind mesh:
This writes a model index entry:
The endpoint becomes active:
Test it:
Expected result:
Container Update and Versioning
To deploy a new version:
Versioning is immutable. Each version receives its own hash and cannot be overwritten. Old versions remain active unless manually revoked.
Security and Authenticity
Each model is signed at registration using the deployer’s private key. Nodes verify:
Manifest digest
Image hash
Entry script existence
Schema compliance
Only models that pass full validation are scheduled for execution.
Summary
Deploying on InfraMind means turning your model into a verifiable runtime package, pushing it to decentralized storage, and exposing it to the global mesh through a signed registration. The process takes under 10 minutes and produces a portable container that can run anywhere in the world, on any compliant node, with no DevOps required.
Last updated

