• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Thursday, May 8, 2025
Techcratic
Click For A Secret Deal
  • TC
  • AI
    Artificial Intelligence

    3 Excellent Practical Generative AI Courses

    Artificial Intelligence

    Building End-to-End Data Pipelines with Dask

    Artificial Intelligence

    Automate document translation and standardization with Amazon Bedrock and Amazon Translate

    Artificial Intelligence

    InterVision accelerates AI development using AWS LLM League and Amazon SageMaker AI

    Artificial Intelligence

    FireDucks: An Accelerated Fully Compatible Pandas Library

    Artificial Intelligence

    Breaking Out of Beginner: Python Patterns for Intermediate Data Scientists

    Artificial Intelligence

    Building a Personal Knowledge Management Tool with Reor

    Artificial Intelligence

    Build a location-aware agent using Amazon Bedrock Agents and Foursquare APIs

    Artificial Intelligence

    How to Fully Automate Text Data Cleaning with Python in 5 Steps

  • Crypto
    Within 48 Hours, 2 US States Enact Strategic Bitcoin Reserve Legislation

    Within 48 Hours, 2 US States Enact Strategic Bitcoin Reserve Legislation

    Hashdex Seeks SEC Approval to Add Litecoin to Crypto Index ETF

    SOL Strategies, Superstate Plan Solana Equity Tokenization

    Celsius Boss Falls: Alex Mashinsky Sentenced to 12 Years for $7B Fraud

    Celsius Boss Falls: Alex Mashinsky Sentenced to 12 Years for $7B Fraud

    Best Presales to Buy Today – Which Coins Are Poised for a Breakout?

    Still Under $0.01 – 3 Breakout Cryptos Flashing Early Bullish Signals

    Alpen Labs Launches Bitcoin-Backed Stablecoin to Boost Censorship Resistance

    Alpen Labs Launches Bitcoin-Backed Stablecoin to Boost Censorship Resistance

    Stripe Unveils Stablecoin Financial Accounts for Businesses in 101 Countries

    Stripe Unveils Stablecoin Financial Accounts for Businesses in 101 Countries

    Revolut to Enhance Bitcoin Lightning Infrastructure in Europe via Lightspark

    Revolut to Enhance Bitcoin Lightning Infrastructure in Europe via Lightspark

    Core Scientific Posts $580M Q1 Profit, Misses Revenue Estimates

    Core Scientific Posts $580M Q1 Profit, Misses Revenue Estimates

    Citi Unveils Tokenization Initiative With SDX at Zurich Forum

    Citi Unveils Tokenization Initiative With SDX at Zurich Forum

  • Cybersecurity
    Cybersecurity

    SonicWall Patches 3 Flaws in SMA 100 Devices Allowing Attackers to Run Code as Root

    Cybersecurity

    Qilin Ransomware Ranked Highest in April 2025 with Over 45 Data Leak Disclosures

    Cybersecurity

    MirrorFace Targets Japan and Taiwan with ROAMINGMOUSE and Upgraded ANEL Malware

    Cybersecurity

    Cisco Patches CVE-2025-20188 (10.0 CVSS) in IOS XE That Enables Root Exploits via JWT

    Cybersecurity

    OttoKit WordPress Plugin with 100K+ Installs Hit by Exploits Targeting Multiple Flaws

    Cybersecurity

    A Technical Gap Analysis of Last-Mile Protection

    Cybersecurity

    Entra ID Data Protection: Essential or Overkill?

    Cybersecurity

    Microsoft Warns Default Helm Charts Could Leave Kubernetes Apps Exposed to Data Leaks

    Cybersecurity

    Google Fixes Android Flaw (CVE-2025-27363) Exploited by Attackers

  • Deals
    StarTech.com 5-Port USB PCIe Card – USB 3.2 Gen 2 (10Gbps) PCIe Card w/ 1x USB-C & 2x…

    StarTech.com 5-Port USB PCIe Card – USB 3.2 Gen 2 (10Gbps) PCIe Card w/ 1x USB-C & 2x…

    Seagate Expansion 22TB External Hard Drive HDD – USB 3.0, with Rescue Data Recovery…

    Seagate Expansion 22TB External Hard Drive HDD – USB 3.0, with Rescue Data Recovery…

    Samsung 65 Inch DU8000 Crystal UHD LED 4K Smart TV Bundle with 2 YR CPS Enhanced…

    Samsung 65 Inch DU8000 Crystal UHD LED 4K Smart TV Bundle with 2 YR CPS Enhanced…

    PNY GeForce GTX 1660 Super 4GB XLR8 Gaming Overclocked Edition Single Fan (Renewed)

    PNY GeForce GTX 1660 Super 4GB XLR8 Gaming Overclocked Edition Single Fan (Renewed)

    Honda Pioneer 1000 Oil Change Kit

    Honda Pioneer 1000 Oil Change Kit

    ORICO USB C Hub 4 Ports, USB C to USB Multiport Adapter with 4 USB 3.0 Ports, USB C…

    ORICO USB C Hub 4 Ports, USB C to USB Multiport Adapter with 4 USB 3.0 Ports, USB C…

    ASUS ROG Harpe Gaming Wireless Mouse, Ace Aim Lab Edition, 54g Ultra-Lightweight, 36,000…

    ASUS ROG Harpe Gaming Wireless Mouse, Ace Aim Lab Edition, 54g Ultra-Lightweight, 36,000…

    2024 Apple iPad Air (13-inch, Wi-Fi + Cellular, 128GB) – Starlight (Renewed Premium)

    2024 Apple iPad Air (13-inch, Wi-Fi + Cellular, 128GB) – Starlight (Renewed Premium)

    UGREEN 65W USB C Charger Nexode X Series, 3-Port PPS Ultra Compact Fast GaN Foldable…

    UGREEN 65W USB C Charger Nexode X Series, 3-Port PPS Ultra Compact Fast GaN Foldable…

  • Gaming
    Minish Cap 100% Walkthrough – Part 42/61 – Joy Butterflies

    Minish Cap 100% Walkthrough – Part 42/61 – Joy Butterflies

    Woodland Temple! The Legend of Zelda: Majora's Mask Gameplay Walkthrough

    Woodland Temple! The Legend of Zelda: Majora's Mask Gameplay Walkthrough

    Alien: Rogue Incursion will escape its VR shackles and become a normal bug-hunt shooter later this year

    Alien: Rogue Incursion will escape its VR shackles and become a normal bug-hunt shooter later this year

    Zelda Ocarina of Time 3D – TOO SPOOKY FOR ME | Let's Play Walkthrough Part 30

    Zelda Ocarina of Time 3D – TOO SPOOKY FOR ME | Let's Play Walkthrough Part 30

    Lost Lands 8: Sand Captivity CE [31] Let's Play walkthrough – Part 31

    Lost Lands 8: Sand Captivity CE [31] Let's Play walkthrough – Part 31

    Zelda Link's Awakening 100% Walkthrough: Episode 01

    Zelda Link's Awakening 100% Walkthrough: Episode 01

    LM Studio Accelerates LLM With GeForce RTX GPUs

    LM Studio Accelerates LLM With GeForce RTX GPUs

    The Legend of Zelda Ocarina of Time Walkthrough Ep6 – Dodongo's Mini Boss

    The Legend of Zelda Ocarina of Time Walkthrough Ep6 – Dodongo's Mini Boss

    MORE ZELDA!! (Ghost Plays…The Legend of Zelda: The Minish Cap)

    MORE ZELDA!! (Ghost Plays…The Legend of Zelda: The Minish Cap)

  • Tesla
    Cyber Truck Toy Trucks Toy Cars with Motorcycle Diecast Metal Cybertruck Model Pickup…

    Cyber Truck Toy Trucks Toy Cars with Motorcycle Diecast Metal Cybertruck Model Pickup…

    Anti-Fingerprint Door Handles Set for Tesla Cybertruck 2024, Fingerprint Resistant Door…

    Anti-Fingerprint Door Handles Set for Tesla Cybertruck 2024, Fingerprint Resistant Door…

    9 PCS Automotive Main Cam Locking Tool, Engine Concave and Convex Locking Double…

    9 PCS Automotive Main Cam Locking Tool, Engine Concave and Convex Locking Double…

    7 Pin Trailer Plug,Car Accessories 7 Way Trailer Plug,Trailer Light Adapter with…

    7 Pin Trailer Plug,Car Accessories 7 Way Trailer Plug,Trailer Light Adapter with…

    Tesla loses head of India just as it is rumored to finally enter the market

    XINDELL 29-inch Windshield Cleaner Tool – Car Interior Cleaning Brush Kit with…

    XINDELL 29-inch Windshield Cleaner Tool – Car Interior Cleaning Brush Kit with…

    ZKFAR 1 PC Car Seat Gap Storage Box, Multifunctional Leather Set Box, Car Seat Gap…

    ZKFAR 1 PC Car Seat Gap Storage Box, Multifunctional Leather Set Box, Car Seat Gap…

    Mplus Electric Vehicle Charger Station 16 Amp Level 1 & 2 Portable EV Charging Includes…

    Mplus Electric Vehicle Charger Station 16 Amp Level 1 & 2 Portable EV Charging Includes…

    3 Pocket Cargo net for Cybertruck Cargo Net Tesla Cybertruck Accessories 2025+…

    3 Pocket Cargo net for Cybertruck Cargo Net Tesla Cybertruck Accessories 2025+…

  • UFO
    Bigfoot UFO Lived With THIS Native Tribe

    Bigfoot UFO Lived With THIS Native Tribe

    Top Baseball Caps for Women-Men Outdoor Baseball Hats New York Golf Sports Hat Curved-Brim UV Protection

    Top Baseball Caps for Women-Men Outdoor Baseball Hats New York Golf Sports Hat Curved-Brim UV Protection

    Project Grudge: Unraveling the Truth Behind the UFO Investigations

    Project Grudge: Unraveling the Truth Behind the UFO Investigations

    Alien Oceans | Explorers in the Field

    Alien Oceans | Explorers in the Field

    Apollo Spacecraft Familiarization Manual

    Apollo Spacecraft Familiarization Manual

    Ancient Aliens: UFO Fuel Source Discovered! (S14, E3) | Full Episode

    Real Alien Contactee Story!!!

    Real Alien Contactee Story!!!

    Bvlgari Green Tea By Bvlgari For Men and Women, Cologne Spray, 2.5-Ounce Bottle

    Bvlgari Green Tea By Bvlgari For Men and Women, Cologne Spray, 2.5-Ounce Bottle

    Naughty Dog JUST GOT DESTROYED By Viral Intergalactic Redesign And It Shows What Gamers REALLY Want!

    Naughty Dog JUST GOT DESTROYED By Viral Intergalactic Redesign And It Shows What Gamers REALLY Want!

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    3 Excellent Practical Generative AI Courses

    Artificial Intelligence

    Building End-to-End Data Pipelines with Dask

    Artificial Intelligence

    Automate document translation and standardization with Amazon Bedrock and Amazon Translate

    Artificial Intelligence

    InterVision accelerates AI development using AWS LLM League and Amazon SageMaker AI

    Artificial Intelligence

    FireDucks: An Accelerated Fully Compatible Pandas Library

    Artificial Intelligence

    Breaking Out of Beginner: Python Patterns for Intermediate Data Scientists

    Artificial Intelligence

    Building a Personal Knowledge Management Tool with Reor

    Artificial Intelligence

    Build a location-aware agent using Amazon Bedrock Agents and Foursquare APIs

    Artificial Intelligence

    How to Fully Automate Text Data Cleaning with Python in 5 Steps

  • Crypto
    Within 48 Hours, 2 US States Enact Strategic Bitcoin Reserve Legislation

    Within 48 Hours, 2 US States Enact Strategic Bitcoin Reserve Legislation

    Hashdex Seeks SEC Approval to Add Litecoin to Crypto Index ETF

    SOL Strategies, Superstate Plan Solana Equity Tokenization

    Celsius Boss Falls: Alex Mashinsky Sentenced to 12 Years for $7B Fraud

    Celsius Boss Falls: Alex Mashinsky Sentenced to 12 Years for $7B Fraud

    Best Presales to Buy Today – Which Coins Are Poised for a Breakout?

    Still Under $0.01 – 3 Breakout Cryptos Flashing Early Bullish Signals

    Alpen Labs Launches Bitcoin-Backed Stablecoin to Boost Censorship Resistance

    Alpen Labs Launches Bitcoin-Backed Stablecoin to Boost Censorship Resistance

    Stripe Unveils Stablecoin Financial Accounts for Businesses in 101 Countries

    Stripe Unveils Stablecoin Financial Accounts for Businesses in 101 Countries

    Revolut to Enhance Bitcoin Lightning Infrastructure in Europe via Lightspark

    Revolut to Enhance Bitcoin Lightning Infrastructure in Europe via Lightspark

    Core Scientific Posts $580M Q1 Profit, Misses Revenue Estimates

    Core Scientific Posts $580M Q1 Profit, Misses Revenue Estimates

    Citi Unveils Tokenization Initiative With SDX at Zurich Forum

    Citi Unveils Tokenization Initiative With SDX at Zurich Forum

  • Cybersecurity
    Cybersecurity

    SonicWall Patches 3 Flaws in SMA 100 Devices Allowing Attackers to Run Code as Root

    Cybersecurity

    Qilin Ransomware Ranked Highest in April 2025 with Over 45 Data Leak Disclosures

    Cybersecurity

    MirrorFace Targets Japan and Taiwan with ROAMINGMOUSE and Upgraded ANEL Malware

    Cybersecurity

    Cisco Patches CVE-2025-20188 (10.0 CVSS) in IOS XE That Enables Root Exploits via JWT

    Cybersecurity

    OttoKit WordPress Plugin with 100K+ Installs Hit by Exploits Targeting Multiple Flaws

    Cybersecurity

    A Technical Gap Analysis of Last-Mile Protection

    Cybersecurity

    Entra ID Data Protection: Essential or Overkill?

    Cybersecurity

    Microsoft Warns Default Helm Charts Could Leave Kubernetes Apps Exposed to Data Leaks

    Cybersecurity

    Google Fixes Android Flaw (CVE-2025-27363) Exploited by Attackers

  • Deals
    StarTech.com 5-Port USB PCIe Card – USB 3.2 Gen 2 (10Gbps) PCIe Card w/ 1x USB-C & 2x…

    StarTech.com 5-Port USB PCIe Card – USB 3.2 Gen 2 (10Gbps) PCIe Card w/ 1x USB-C & 2x…

    Seagate Expansion 22TB External Hard Drive HDD – USB 3.0, with Rescue Data Recovery…

    Seagate Expansion 22TB External Hard Drive HDD – USB 3.0, with Rescue Data Recovery…

    Samsung 65 Inch DU8000 Crystal UHD LED 4K Smart TV Bundle with 2 YR CPS Enhanced…

    Samsung 65 Inch DU8000 Crystal UHD LED 4K Smart TV Bundle with 2 YR CPS Enhanced…

    PNY GeForce GTX 1660 Super 4GB XLR8 Gaming Overclocked Edition Single Fan (Renewed)

    PNY GeForce GTX 1660 Super 4GB XLR8 Gaming Overclocked Edition Single Fan (Renewed)

    Honda Pioneer 1000 Oil Change Kit

    Honda Pioneer 1000 Oil Change Kit

    ORICO USB C Hub 4 Ports, USB C to USB Multiport Adapter with 4 USB 3.0 Ports, USB C…

    ORICO USB C Hub 4 Ports, USB C to USB Multiport Adapter with 4 USB 3.0 Ports, USB C…

    ASUS ROG Harpe Gaming Wireless Mouse, Ace Aim Lab Edition, 54g Ultra-Lightweight, 36,000…

    ASUS ROG Harpe Gaming Wireless Mouse, Ace Aim Lab Edition, 54g Ultra-Lightweight, 36,000…

    2024 Apple iPad Air (13-inch, Wi-Fi + Cellular, 128GB) – Starlight (Renewed Premium)

    2024 Apple iPad Air (13-inch, Wi-Fi + Cellular, 128GB) – Starlight (Renewed Premium)

    UGREEN 65W USB C Charger Nexode X Series, 3-Port PPS Ultra Compact Fast GaN Foldable…

    UGREEN 65W USB C Charger Nexode X Series, 3-Port PPS Ultra Compact Fast GaN Foldable…

  • Gaming
    Minish Cap 100% Walkthrough – Part 42/61 – Joy Butterflies

    Minish Cap 100% Walkthrough – Part 42/61 – Joy Butterflies

    Woodland Temple! The Legend of Zelda: Majora's Mask Gameplay Walkthrough

    Woodland Temple! The Legend of Zelda: Majora's Mask Gameplay Walkthrough

    Alien: Rogue Incursion will escape its VR shackles and become a normal bug-hunt shooter later this year

    Alien: Rogue Incursion will escape its VR shackles and become a normal bug-hunt shooter later this year

    Zelda Ocarina of Time 3D – TOO SPOOKY FOR ME | Let's Play Walkthrough Part 30

    Zelda Ocarina of Time 3D – TOO SPOOKY FOR ME | Let's Play Walkthrough Part 30

    Lost Lands 8: Sand Captivity CE [31] Let's Play walkthrough – Part 31

    Lost Lands 8: Sand Captivity CE [31] Let's Play walkthrough – Part 31

    Zelda Link's Awakening 100% Walkthrough: Episode 01

    Zelda Link's Awakening 100% Walkthrough: Episode 01

    LM Studio Accelerates LLM With GeForce RTX GPUs

    LM Studio Accelerates LLM With GeForce RTX GPUs

    The Legend of Zelda Ocarina of Time Walkthrough Ep6 – Dodongo's Mini Boss

    The Legend of Zelda Ocarina of Time Walkthrough Ep6 – Dodongo's Mini Boss

    MORE ZELDA!! (Ghost Plays…The Legend of Zelda: The Minish Cap)

    MORE ZELDA!! (Ghost Plays…The Legend of Zelda: The Minish Cap)

  • Tesla
    Cyber Truck Toy Trucks Toy Cars with Motorcycle Diecast Metal Cybertruck Model Pickup…

    Cyber Truck Toy Trucks Toy Cars with Motorcycle Diecast Metal Cybertruck Model Pickup…

    Anti-Fingerprint Door Handles Set for Tesla Cybertruck 2024, Fingerprint Resistant Door…

    Anti-Fingerprint Door Handles Set for Tesla Cybertruck 2024, Fingerprint Resistant Door…

    9 PCS Automotive Main Cam Locking Tool, Engine Concave and Convex Locking Double…

    9 PCS Automotive Main Cam Locking Tool, Engine Concave and Convex Locking Double…

    7 Pin Trailer Plug,Car Accessories 7 Way Trailer Plug,Trailer Light Adapter with…

    7 Pin Trailer Plug,Car Accessories 7 Way Trailer Plug,Trailer Light Adapter with…

    Tesla loses head of India just as it is rumored to finally enter the market

    XINDELL 29-inch Windshield Cleaner Tool – Car Interior Cleaning Brush Kit with…

    XINDELL 29-inch Windshield Cleaner Tool – Car Interior Cleaning Brush Kit with…

    ZKFAR 1 PC Car Seat Gap Storage Box, Multifunctional Leather Set Box, Car Seat Gap…

    ZKFAR 1 PC Car Seat Gap Storage Box, Multifunctional Leather Set Box, Car Seat Gap…

    Mplus Electric Vehicle Charger Station 16 Amp Level 1 & 2 Portable EV Charging Includes…

    Mplus Electric Vehicle Charger Station 16 Amp Level 1 & 2 Portable EV Charging Includes…

    3 Pocket Cargo net for Cybertruck Cargo Net Tesla Cybertruck Accessories 2025+…

    3 Pocket Cargo net for Cybertruck Cargo Net Tesla Cybertruck Accessories 2025+…

  • UFO
    Bigfoot UFO Lived With THIS Native Tribe

    Bigfoot UFO Lived With THIS Native Tribe

    Top Baseball Caps for Women-Men Outdoor Baseball Hats New York Golf Sports Hat Curved-Brim UV Protection

    Top Baseball Caps for Women-Men Outdoor Baseball Hats New York Golf Sports Hat Curved-Brim UV Protection

    Project Grudge: Unraveling the Truth Behind the UFO Investigations

    Project Grudge: Unraveling the Truth Behind the UFO Investigations

    Alien Oceans | Explorers in the Field

    Alien Oceans | Explorers in the Field

    Apollo Spacecraft Familiarization Manual

    Apollo Spacecraft Familiarization Manual

    Ancient Aliens: UFO Fuel Source Discovered! (S14, E3) | Full Episode

    Real Alien Contactee Story!!!

    Real Alien Contactee Story!!!

    Bvlgari Green Tea By Bvlgari For Men and Women, Cologne Spray, 2.5-Ounce Bottle

    Bvlgari Green Tea By Bvlgari For Men and Women, Cologne Spray, 2.5-Ounce Bottle

    Naughty Dog JUST GOT DESTROYED By Viral Intergalactic Redesign And It Shows What Gamers REALLY Want!

    Naughty Dog JUST GOT DESTROYED By Viral Intergalactic Redesign And It Shows What Gamers REALLY Want!

No Result
View All Result
Techcratic
No Result
View All Result

Big Gains with Hugging Face’s smolagents

AI by AI
March 7, 2025
in AI
Reading Time: 9 mins read
121 9
A A
0
Home AI
Share on FacebookShare on XShare on LinkedIn

Cornellius Yudha Wijaya
2025-03-07 08:00:00
www.kdnuggets.com

Big Gains with Hugging Face’s smolagents
Image by Author |Ideogram

 

AI agents have become the hottest topic thanks to their strong LLM reasoning capability. These agents can make decisions independently while following the user’s input.

For you who don’t know what AI agents is, you can define it as a program where LLM (Large Language Model) outputs control workflows. The intuition behind AI agents is that we can delegate tasks to machines that were previously unable to be done.

With the agent trend rising, many AI agent frameworks are emerging. Amid the sea of agent framework, you should know about the smolagents.

So, what are smolagents? And how will it help your work?

 

Smolagents Introduction

 
Smolagents is an AI agent framework recently launched by the Hugging Face team to simplify the process of developing AI agents.

It’s a lightweight library that prioritizes practicality. This means it can build AI agents in a few lines of code but focuses more on simple implementation than creating the whole agent system in production.

When you are using smolagents, there are a few features you can expect. They include:

  • It is simple to use as it can perform complex agent logic with a few lines of code.
  • It developed as a code-centric agent, enabling agents to perform their actions directly with Python code.
  • Smolagents are compatible with many LLMs available on the Hugging Face Hub. It also supports various popular models via LiteLLM.
  • The framework supports several modality inputs, such as text, vision, or audio.
  • Able to use all the tools available in the Hugging Face Hub and Hub Spaces. It’s also compatible with tools that come from frameworks such as LangChain.

Given how valuable smolagents are for developing AI agents, let’s try the code implementation to understand them better.

 

Code Implementation

 
Let’s start the coding tutorial by installing the required code.

pip install smolagents huggingface_hub transformers

 

For this tutorial, you will also need a HuggingFace access token, which you will use to log in to HuggingFace from your notebook.

from huggingface_hub import login

login('YOUR-HF-API-KEY')

 

Let’s try building simple agents with Smolagent that can access tools. We will use the free inference model from HuggingFace and the web searching tool.

It’s as simple as importing the library and passing the query we want to execute to do the above. We can structure it like the code below.

from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel

agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())

agent.run("What are the best route to travel from New York to Paris without using Airplane and how long does it take?"

 

Big Gains with Hugging Face’s smolagents
 

The result is shown in the output below.

Step 2: Duration 15.63 seconds| Input tokens: 10,268 | Output tokens: 320]

'Transatlantic cruises from New York to Paris typically take around 10 to 12 days, depending on the cruise line and itinerary. The journey provides a unique opportunity to experience the Atlantic Ocean and visit ports of call along the way

 

You can see that the smolagents can develop agents that access the web to search for the necessary query and produce the correct output.

The details above show that smolagents obtain the result through code execution. That’s why the default LLM used is the Qwen-2.5-Coder-32B-Instruct, which is decisive for code execution.

To use another LLM model, explore the Hugging Face Hub and find the model ID. Then, you can pass it to the model.

model_id = "mistralai/Mistral-7B-Instruct-v0.3"

agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel(model_id=model_id))

 

You will then run it like normal, with different models all around.

Access to tools is essential for agents to be much more powerful. With smolagents, you can develop any kind of tool that you need.

For example, here’s how to develop a tool to check whether the number we pass is prime.

from smolagents import Tool

class PrimeCheckTool(Tool):
    name = "prime_check"
    description = """
    This is a tool that checks if a given number is a prime number.
    It returns True if the number is prime, and False otherwise.
    """
    inputs = {
        "number": {
            "type": "integer",
            "description": "The number to check for primality.",
        }
    }
    output_type = "boolean"


    def forward(self, number: int) -> bool:
        """
        Check if a number is a prime number.


        Args:
            number: The number to check.


        Returns:
            True if number is a prime number, False otherwise.
        """
        if number 

 

We can then pass the tool above into the smolagent for the system to use with the code below.

agent = CodeAgent(tools=[prime_check_tool], model = HfApiModel() )
agent.run("Check if the number 23 is a prime number and provide the result in a nursery rhyme way.")

 
Big Gains with Hugging Face’s smolagents
 

You can see that the agent can use the tool we pass and the complete log of what happens until we receive the result.

The smolagents Python interpreter also doesn’t allow imports outside the predefined safe list. We need to set which additional libraries the agent can access manually. For example, the code below will enable the agent to make requests and use the bs4 library.

agent = CodeAgent(tools=[], model=HfApiModel(), additional_authorized_imports=['requests', 'bs4'])

agent.run("Could you get me the title of the page at url 'https://www.kdnuggets.com/5-ai-agent-frameworks-compared'?. Don't use tools")

 

Big Gains with Hugging Face’s smolagents
 

Lastly, smolagents allow the implementation of a Multi-Agent System (MAS) that would enable multiple agents to interact and collaborate to solve much more complex tasks. The system can achieve much better results using several specialized agents.

For example, we can initiate two web search agents and check prime numbers. Then, we set up a manager agent to manage both agents. The whole code implementation is shown below.

from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool, ToolCallingAgent

model = HfApiModel()

web_agent = ToolCallingAgent(tools=[DuckDuckGoSearchTool()],
                             model=model,
                             name="web_search",
                              description="Runs web searches for you. Give it your task as an argument.")

prime_check_agent = ToolCallingAgent(tools=[prime_check_tool],
                                   model=model,
                                   name="prime_chek",
                                  description="Check whether the number is prime or not. Give it your number as an argument.")


manager_agent = CodeAgent(
  tools=[], model=model, managed_agents=[web_agent, image_gen_agent],
)

 

With the smolagents MAS ready, we can pass our query to the manager agent for further processing.

manager_agent.run("Who is the elected president of United States in 2024 and does the age of that president during elected is prime number or not?")

 

After using all the code, the final output is similar to the below output.

The elected president of the United States in 2024 is Donald Trump, and his age during the election (78) is not a prime number.

 

You can always add another agent to the tools used for each agent. This powerful yet simple system can help you work.

 

Conclusion

 
Hugging Face recently released a lightweight library called smolagents for developing AI agents. This simple yet powerful framework allows for minimal code development of an AI agent system. In this article, we discuss the strengths of the smolagent and the code’s implementation.

I hope this has helped!
 
 

Cornellius Yudha Wijaya is a data science assistant manager and data writer. While working full-time at Allianz Indonesia, he loves to share Python and data tips via social media and writing media. Cornellius writes on a variety of AI and machine learning topics.

Source Link



Shark AI Ultra Voice Control Robot Vacuum

Transform your cleaning routine with the Shark AI Ultra Voice Control Robot Vacuum! This high-tech marvel boasts over 32,487 ratings, an impressive 4.2 out of 5 stars, and has been purchased over 900 times in the past month. Perfect for keeping your home spotless with minimal effort, this vacuum is now available for the unbeatable price of $349.99!

Don’t miss out on this limited-time offer. Order now and let Shark AI do the work for you!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: AI NEWS
Share161Tweet101Share28
Previous Post

Who Makes Aircraft Tires And How Much Do They Cost?

Next Post

Nvidia expected to announce RTX 5060 and 5060 Ti next week, launch in April

AI

AI

Explore the dynamic realm of AI, where breakthroughs and trends are shaping the future. Stay informed and see how AI is making an impact. Don’t miss the crucial updates—read the latest articles here at Techcratic.

Related Posts

Artificial Intelligence
AI

3 Excellent Practical Generative AI Courses

May 7, 2025
1.3k
Artificial Intelligence
AI

Building End-to-End Data Pipelines with Dask

May 5, 2025
1.3k
Artificial Intelligence
AI

Automate document translation and standardization with Amazon Bedrock and Amazon Translate

May 1, 2025
1.3k
Artificial Intelligence
AI

InterVision accelerates AI development using AWS LLM League and Amazon SageMaker AI

April 29, 2025
1.3k
Artificial Intelligence
AI

FireDucks: An Accelerated Fully Compatible Pandas Library

April 29, 2025
1.3k
Artificial Intelligence
AI

Breaking Out of Beginner: Python Patterns for Intermediate Data Scientists

April 28, 2025
1.3k
Load More
Next Post
Nvidia expected to announce RTX 5060 and 5060 Ti next week, launch in April

Nvidia expected to announce RTX 5060 and 5060 Ti next week, launch in April

Microsoft philanthropy chief will salsa her way to helping combat homelessness in ‘Seattle Dances’ – GeekWire

Microsoft philanthropy chief will salsa her way to helping combat homelessness in 'Seattle Dances' – GeekWire

Smartphone

Arm showed me the future of mobile gaming at MWC 2025

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • AnandTech
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • Home
  • Apple
  • Gaming
  • Microsoft
  • AnandTech