页面简介
We’re on a journey to advance and democratize artificial intelligence through open source and open science.
正文摘录
smolagents documentation Installation Options smolagents 🏡 View all docsAWS Trainium & InferentiaAccelerateBitsandbytesCLIChat UIDataset viewerDatasetsDeploying on AWSDiffusersGoogle CloudGoogle TPUsGradioHubHub Python LibraryHuggingface.jsInference Endpoints (dedicated)Inference ProvidersKernelsLeRobotLeaderboardsLightevalMicrosoft AzureOpenEnvOptimumPEFTReachy MiniSafetensorsSentence TransformersTRLTasksText Embeddings InferenceTokenizersTrackioTransformersTransformers.jsXetsmolagentstimm Search documentation mainv1.26.0v1.25.0v1.24.0v1.23.0v1.22.0v1.21.2v1.20.0v1.19.0v1.18.0v1.17.0v1.16.1v1.15.0v1.14.0v1.13.0v1.12.0v1.11.0v1.10.0v1.9.2v1.8.1v1.7.0v1.6.0v1.5.1v1.4.1v1.3.0v1.2.2v1.1.0v0.1.3 ENHIKOZH Join the Hugging Face community and get access to the augmented documentation experience Collaborate on models, datasets and Spaces Faster examples with accelerated inference Switch between documentation themes Sign Up to get started Copy page Installation Options The smolagents library can be installed using pip. Here are the different installation methods and options available. Prerequisites Python 3.10 or newer Python package manager: pip or uv Virtual Environment It’s strongly recommended to install smolagents within a Python virtual environment. Virtual environments isolate your project dependencies from other Python projects and your system Python installation, preventing version conflicts and making package management more reliable. venv uv Using venv: Copied python -m venv .venv source .venv/bin/activate Basic Installation Install smolagents core library with: pip uv Copied pip install smolagents Installation with Extras smolagents provides several optional dependencies (extras) that can be installed based on your needs. You can install these extras using the following syntax: pip uv Copied pip install "smolagents[extra1,extra2]" Tools These extras include various tools and integrations: pip uv toolkit: Install a default set of tools for common tasks. Copied pip install "smolagents[toolkit]" mcp: Add support for the Model Context Protocol (MCP) to integrate with external tools and services. Copied pip install "smolagents[mcp]" Model Integration These extras enable integration with various AI models and frameworks: pip uv openai: Add support for OpenAI API models. Copied pip install "smolagents[openai]" transformers: Enable Hugging Face Transformers models. Copied pip install "smolagents[transformers]" vllm: Add VLLM support for efficient model inference. Copied pip install "smolagents[vllm]" mlx-lm: Enable support for MLX-LM models. Copied pip install "smolagents[mlx-lm]" litellm: Add LiteLLM support for lightweight model inference. Copied pip install "smolagents[litellm]" bedrock: Enable support for AWS Bedrock models. Copied pip install "smolagents[bedrock]" Multimodal Capabilities Extras for handling different types of media and input: pip uv vision: Add support for image processing and computer vision tasks. Copied pip install "smolagents[vision]" audio: Enable audio processing capabilities. Copied pip install "smolagents[audio]" Remote Execution Extras for executing code remotely: pip uv blaxel: Add support for Blaxel sandboxes - fast-launching VMs with hibernation (recommended). Copied pip install "smolagents[blaxel]" e2b: Enable E2B support for remote execution. Copied pip install "smolagents[e2b]" docker: Add support for executing code in Docker containers. Copied pip install "smolagents[docker]" Telemetry and User Interface Extras for telemetry, monitoring and user interface components: pip uv telemetry: Add support for monitoring and tracing. Copied pip install "smolagents[telemetry]" gradio: Add support for interactive Gradio UI components. Copied pip install "smolagents[gradio]" Complete Installation To install all available extras, you can use: pip uv Copied pip install "smolagents[all]" Verifying Installation After installation, you can verify that smolagents is installed correctly by running: Copied import smolagents print(smolagents.__version__) Next Steps Once you have successfully installed smolagents, you can: Follow the guided tour to learn the basics. Explore the how-to guides for practical examples. Read the conceptual guides for high-level explanations. Check out the tutorials for in-depth tutorials on building agents. Explore the API reference for detailed information on classes and functions. Update on GitHub ←Introduction Guided tour→