---
title: "Introducing the Hugging Face Embedding Container for Amazon SageMaker"
description: "The Hugging Face Embedding Container for Amazon SageMaker, built on Text Embedding Inference (TEI), is now generally available for deploying open embedding models such as Snowflake Arctic Embed and BGE."
url: "https://swe.quest/articles/introducing-the-hugging-face-embedding-container-for-amazon-sagemaker-cc289650f9404f51"
canonical: "https://huggingface.co/blog/sagemaker-huggingface-embedding"
source: "Hugging Face"
published: "2024-06-07"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["inference","cloud","rag","python"]
---

# Introducing the Hugging Face Embedding Container for Amazon SageMaker

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-06-07, 7 min read, How-to. Original: [https://huggingface.co/blog/sagemaker-huggingface-embedding](https://huggingface.co/blog/sagemaker-huggingface-embedding)

## Summary

The Hugging Face Embedding Container for Amazon SageMaker, built on Text Embedding Inference (TEI), is now generally available for deploying open embedding models such as Snowflake Arctic Embed and BGE. TEI uses token-based dynamic batching, Flash Attention and Candle, and ships separate CPU and GPU images. A walkthrough with the sagemaker Python SDK covers retrieving the image URI, deploying snowflake-arctic-embed-m-v1.5 and load testing it. In the test, embedding ~1M tokens took about 841s (~5 req/s, 2s latency) on a ~$150/month CPU instance versus about 30s (~130 req/s, 4ms latency) on an ml.g5.xlarge A10G GPU at $1.408/hour. The recommendation is GPUs for bulk embedding and CPUs for low-cost endpoints.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- AWS SageMaker basics ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- text embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- Python ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Text Embedding Inference, Amazon SageMaker, Snowflake Arctic Embed, Hugging Face, sagemaker SDK

## Related posts

- [Deploy Embedding Models with Hugging Face Inference Endpoints](https://swe.quest/articles/deploy-embedding-models-with-hugging-face-inference-endpoints-e85e7e272a9c97bc.md): Hugging Face · 2023-10-24 · Medium · 5 min read · Inference & serving, RAG & retrieval, ML platforms
  Open-source embedding models such as BAAI/bge-base-en-v1.5 can be deployed on Hugging Face Inference Endpoints using Text Embeddings Inference (TEI), which offers token-based dynamic batching, Flash Attention, Candle and cuBLASLt kernels, safetensors loading, small images for fast boot, and OpenTelemetry/Prometheus support.
- [Introducing the Hugging Face LLM Inference Container for Amazon SageMaker](https://swe.quest/articles/introducing-the-hugging-face-llm-inference-container-for-amazon-sagemaker-49df0e101e3d8d72.md): Hugging Face · 2023-05-31 · Medium · 8 min read · Inference & serving, LLMs, Cloud platforms, Python
  Hugging Face's LLM Inference Deep Learning Container for Amazon SageMaker is built on Text Generation Inference (TGI), which provides tensor parallelism, continuous batching, flash-attention, bitsandbytes quantization, safetensors loading and SSE token streaming.
- [Hugging Face Text Generation Inference available for AWS Inferentia2](https://swe.quest/articles/hugging-face-text-generation-inference-available-for-aws-inferentia2-4404accc08bd48f1.md): Hugging Face · 2024-02-01 · Medium · 7 min read · Inference & serving, LLMs, Cloud platforms, Python
  Text Generation Inference (TGI) is now generally available on AWS Inferentia2 through Amazon SageMaker, offering an alternative to GPUs for serving open LLMs such as Llama and Mistral.
- [Deploy Hugging Face models easily with Amazon SageMaker](https://swe.quest/articles/deploy-hugging-face-models-easily-with-amazon-sagemaker-e09e9e34ef94ffa8.md): Hugging Face · 2021-07-08 · Medium · 9 min read · Inference & serving, Cloud platforms, ML platforms, Python
  Hugging Face Inference Deep Learning Containers and the SageMaker Hugging Face Inference Toolkit let Transformers models be deployed as SageMaker endpoints with a few lines of Python, using transformers pipelines for zero-code pre- and post-processing.
- [How to deploy and fine-tune DeepSeek models on AWS](https://swe.quest/articles/how-to-deploy-and-fine-tune-deepseek-models-on-aws-e64f345de2597515.md): Hugging Face · 2025-01-30 · Medium · 8 min read · Inference & serving, Cloud platforms, LLMs, Python
  DeepSeek-R1's distilled Llama and Qwen models can be deployed on AWS through Hugging Face Inference Endpoints, Bedrock Marketplace, SageMaker with Hugging Face LLM DLCs (TGI v3) on GPUs or Neuron, and EC2 Inferentia via the Hugging Face Neuron AMI.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
