2025 m. vasario 13 d., ketvirtadienis

Learning courses and Notes

Hugging Face AI Agents Course

Note that Actions are not the same as Tools. An Action, for instance, can involve the use of multiple Tools to complete. 

Agent is a system that uses an AI Model (typically a LLM) as its core reasoning engine, to:

  • Understand natural language: Interpret and respond to human instructions in a meaningful way.

  • Reason and plan: Analyze information, make decisions, and devise strategies to solve problems.

  • Interact with its environment: Gather information, take actions, and observe the results of those actions.

Introduction to the Focused and Diffuse Modes



Diffuse (as opposed to the focused) mode of thinking:

The diffuse mode could be thought of as a flashlight set so that it casts its light very broadly, but not very strongly in any one area. (As opposed to the focused mode, which would have its light cast very strongly in a single area, but very weakly everywhere else.)
The type of thinking you need to do when you are trying to understand something new.

Chat-Templates

As mentioned, chat templates are essential for structuring conversations between language models and users. They guide how message exchanges are formatted into a single prompt.


Base Models vs. Instruct Models

Another point we need to understand is the difference between a Base Model vs. an Instruct Model:

  • A Base Model is trained on raw text data to predict the next token.

  • An Instruct Model is fine-tuned specifically to follow instructions and engage in conversations. For example, SmolLM2-135M is a base model, while SmolLM2-135M-Instruct is its instruction-tuned variant.

The Core Components

Agents work in a continuous cycle of: thinking (Thought) → acting (Act) and observing (Observe).

Let’s break down these actions together:

  1. Thought: The LLM part of the Agent decides what the next step should be.
  2. Action: The agent takes an action, by calling the tools with the associated arguments.
  3. Observation: The model reflects on the response from the tool.

The Core Components

Agents work in a continuous cycle of: thinking (Thought) → acting (Act) and observing (Observe).

Let’s break down these actions together:

  1. Thought: The LLM part of the Agent decides what the next step should be.
  2. Action: The agent takes an action, by calling the tools with the associated arguments.
  3. Observation: The model reflects on the response from the tool.

Links:

 
Going deeper: