Member-only story
How to Use DeepScaleR-1.5B-Preview with Hugging Face Inference Endpoints: A Step-by-Step Tutorial
If you’re excited about DeepScaleR-1.5B-Preview, the compact yet powerful language model that outperforms OpenAI’s o1-preview, you’re in the right place! In this tutorial, I’ll walk you through how to use this model with Hugging Face Inference Endpoints. Whether you’re a developer, researcher, or AI enthusiast, this guide will help you get started in minutes.
What You’ll Need
- A Hugging Face account (sign up here if you don’t have one).
- An API key from Hugging Face (you can generate one in your account settings).
- Basic knowledge of Python.
Step 1: Install the Required Library
To interact with Hugging Face Inference Endpoints, you’ll need the huggingface_hub
library. If you don’t have it installed, run the following command:
pip install huggingface_hub
Step 2: Set Up the Inference Client
Once the library is installed, you can set up the InferenceClient
to interact with the DeepScaleR-1.5B-Preview model. Here’s the code to get started:
from huggingface_hub import InferenceClient
# Initialize the InferenceClient
client = InferenceClient(
provider="hf-inference",
api_key="api_key" # Replace with your Hugging Face API key
)