Environment variables in running containers

We now expose the following metadata as environment variables in a running container.

They can be used to identify the image, version, deployment, when debugging or instrumenting your model.

  • REPLICATE_USERNAME - username, e.g. my-unicorn-ai-startup
  • REPLICATE_MODEL_NAME - model name, e.g. pony-generator
  • REPLICATE_DOCKER_IMAGE_URI - Docker image URI, e.g. r8.im/<username>/<model_name>@<image_hash>
  • REPLICATE_VERSION_ID - model version, usually the same as image hash
  • REPLICATE_DEPLOYMENT_NAME - deployment name, if running as a deployment

These environment variables are accessible to your code in public models, private models, and deployments.

For more details, see the model documentation.