SmolAgent_Tutorial/T0_Installation/Readme.md

2.9 KiB

SmolAgents Tutorial 0: Installation and Setup

Table of Contents

Overview

SmolAgents is a development toolkit designed to help you build and experiment with AI agents. This tutorial series guides you through the complete setup and installation process, serving as your starting point for working with SmolAgents.

Key features of this tutorial:

  • Complete environment setup instructions
  • Multiple model support (Ollama and Hugging Face)
  • Step-by-step installation process
  • Python environment configuration

This initial tutorial (T0) focuses on the installation and setup requirements to ensure you have a proper development environment for working with SmolAgents. You'll learn how to set up both local models through Ollama and cloud-based models via Hugging Face, giving you flexibility in your development approach.

Target audience:

  • Developers interested in AI agent development
  • Researchers working with language models
  • Anyone looking to experiment with SmolAgents

After completing this tutorial, you'll have a fully configured environment ready for developing and testing SmolAgents applications.

Installation

Install Ollama

macOS

Download

Windows

Download

Linux

curl -fsSL https://ollama.com/install.sh | sh

Pull Test Model

ollama pull llama3.2

OR

Hugging Face API Setup

To use Hugging Face models with SmolAgents, follow these steps to set up your API access:

  1. Create a Hugging Face Account

    • Visit the Hugging Face website
    • Click on "Sign Up" in the top right corner
    • Choose your preferred sign-up method (Google, GitHub, or email)
    • Complete the registration process
    • Verify your email if required
  2. Generate an API Token

    • Log in to your Hugging Face account
    • Navigate to Settings → Access Tokens
    • Click on "New Token"
    • Select "Read" access for basic model inference
    • Give your token a descriptive name (e.g., "SmolAgents-API")
    • Copy and save your token securely
  3. Configure Your Environment

    # Set your API token as an environment variable
    # For Linux/MacOS
    export HUGGING_FACE_API_KEY='your-api-token-here'
    
    # For Windows (Command Prompt)
    set HUGGING_FACE_API_KEY=your-api-token-here
    
    # For Windows (PowerShell)
    $env:HUGGING_FACE_API_KEY='your-api-token-here'
    
    
    

Conda Environment Setup

conda create -n smolagent python=3.12
conda activate smolagent