Get Started

Model Demo Interfaces, From a Function to a Shareable App

A model demo has one contract: an input, a model call, and an output. Put a limit on each part before you share the link.

90 minutesBuildPythonMembers

Learning Objectives

  • Write the input, model call, and output contract of a demo, with a limit on each part.
  • Build a standard library HTTP app with one HTML page, a JSON endpoint, and a Server-Sent Events endpoint.
  • Validate input in order of cost, and return JSON errors that tell the user the next action.
  • Protect a public demo with a per-client token bucket, a daily usage cap, and an optional access token.
  • Write request logs that keep no input text and no client address.
  • Compare the standard library demo with two framework versions, and name the signals that a demo must become a product.