Deploy scalable inference with Ray Serve

domain: docs.ray.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install Ray with Serve extras: pip install 'ray[serve]'
  2. Define a deployment class decorated with @serve.deployment, implementing a __call__ method (or async def __call__) that accepts a Request and returns a response
  3. Bind the deployment to create an application object: app = MyModel.bind() — pass constructor arguments here for model loading
  4. Deploy programmatically: serve.run(app) or from the CLI: serve run service:app — the deployment is accessible at http://localhost:8000 by default
  5. Configure scaling by passing num_replicas or autoscaling_config to the @serve.deployment decorator: @serve.deployment(num_replicas='auto', max_ongoing_requests=100)
  6. For production on a Ray cluster, write a Serve config YAML and apply it with serve deploy config.yaml targeting the cluster address

Known gotchas

Related routes

KServe: deploy a model as an InferenceService with autoscaling on Kubernetes
ml-ops · 5 steps · unrated
KServe: deploy an InferenceService on Kubernetes
kserve.github.io/website/docs · 6 steps · unrated
KServe: perform a canary rollout by splitting traffic between two InferenceService revisions
ml-ops · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans