Lab build

Falcon-40B on a SageMaker endpoint

Deploys Falcon-40B-Instruct to a GPU SageMaker endpoint using the Hugging Face LLM container.

Role
Builder, end to end
Group
LLMOps and AIOps
Services
AI & LLM systems · MLOps & cloud

What it does

The Hugging Face LLM inference container image is retrieved through the SageMaker SDK and configured to load tiiuae/falcon-40b-instruct across four GPUs. The model is deployed to an ml.g5.12xlarge real-time endpoint and queried from a notebook with sampling parameters.

What was built

  1. 01

    get_huggingface_llm_image_uri selects the Hugging Face LLM container, version 0.8.2.

  2. 02

    HuggingFaceModel config sets HF_MODEL_ID to falcon-40b-instruct and SM_NUM_GPUS to 4.

  3. 03

    Endpoint runs on one ml.g5.12xlarge instance and is called with top_p, temperature and token limits.

The pipeline, layer by layer

Four layers, one pipeline.

  1. L1Setup

    • SageMaker session
    • LLM container image
  2. L2Model

    • Falcon-40B-Instruct model
  3. L3Endpoint

    • ml.g5.12xlarge endpoint
  4. L4Client

    • Notebook inference payload

Stack

  • Amazon SageMaker
  • SageMaker Python SDK
  • Hugging Face LLM container
  • Falcon-40B-Instruct
  • boto3
  • Jupyter

Next lab build · 10 / 46

Blog generator on Bedrock and Lambda

Serverless API that writes a 200-word blog post with Llama 2 on Bedrock and stores it in S3.

Previous: AI music composer

Need a system like this in production? Tell us about it.