English中文

Replicate

Most popular AI cloud service

Introduction

  1. Run models in the cloud at scale
  • Replicate allows running ML models with minimal coding, without deep understanding of ML​.
curl -s -X POST \
    -d '{"version": "db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf", \
        "input": { "prompt": "an astronaut riding on a horse" } }' \
    -H "Authorization: Token $REPLICATE_API_TOKEN" \
    -H 'Content-Type: application/json' \
    https://api.replicate.com/v1/predictions
  1. Push: Package ML models easily
  • Cog, an open-source tool by Replicate, packages ML models into production-ready containers
  • only 4 steps to push your model into cloud
    1. define the environment your model runs in with cog.yaml
build:
    gpu: true
    system_packages:
        - "libgl1-mesa-glx"
        - "libglib2.0-0"
    python_version: "3.10"
    python_packages:
        - "torch==1.13.1"
predict: "predict.py:Predictor"
  1. define how predictions are run on your model with predict.py
from cog import BasePredictor, Input, Path
import torch

class Predictor(BasePredictor):
    def setup(self):
        """Load the model into memory to make running multiple predictions efficient"""
        self.model = torch.load("./weights.pth")

    # The arguments and types the model takes as input
    def predict(self,
        image: Path = Input(description="Grayscale input image")
    ) -> Path:
        """Run a single prediction on the model"""
        processed_image = preprocess(image)
        output = self.model(processed_image)
        return postprocess(output)
  1. then you can run predictions on this model locally
cog predict -i @input.jpg                
  1. Finally, push your model to Replicate, and you can run it in the cloud with a few lines of code
cog push
  1. Scale: Deploy ML models at scale
  • scaling is 100% your choice
    • Automatic scale
    • Automatic API
  • Pay by second billing system

Investment Info

2023-May-27

  • crunchbase organization: Replicate
  • Total Funding Amount: USD$17.8M
  • value estimated: Not Sure