MCP Agent Fine tuning Workshop - Ronan McGovern

Workshop Overview 00:00

  • Ronan McGovern introduces the workshop on fine-tuning MCP agents, detailing objectives and outcomes.
  • The goal is to generate high-quality reasoning traces, save logs, fine-tune a model (specifically Quen 3), and evaluate performance improvements.

Introduction to MCP 01:02

  • MCP (Model Context Protocol) facilitates LLMs' access to tools, such as a web browser.
  • It serves as a repository of tool information and manages tool execution, returning results to the LLM.
  • An API endpoint will expose the language model, requiring conversions between MCP and OpenAI formats.

Data Collection and Model Setup 05:14

  • Users must clone the provided repository and navigate to the MCP agent fine-tune folder for instructions.
  • Emphasis on using a consistent model for data generation and fine-tuning, recommending a 30 billion parameter Quen model.
  • The setup requires defining a Docker image, enabling reasoning, and specifying tool parsers for tool calls.

Running the Agent 10:19

  • The agent is run to perform tasks like navigating to a website and retrieving specific information.
  • Logging features capture both user messages and tool interactions needed for fine-tuning.
  • The importance of generating multiple high-quality traces is highlighted for effective model training.

Trace Adjustment and Saving 13:46

  • Users are encouraged to clean up traces by merging or modifying logs to ensure quality training data.
  • Pushing the cleaned data to the Hugging Face hub for fine-tuning is discussed, focusing on unrolling multiple interaction turns for better training efficacy.

Fine-Tuning Process 22:51

  • Introduction to the fine-tuning notebook setup, including installing necessary libraries and preparing model parameters.
  • Discussion on applying low-rank adapters (LoRA) to the model focuses on specific matrices to enhance training efficiency.

Training and Evaluation 29:10

  • The training process involves testing the model's performance before and after fine-tuning, noting improvements in task execution.
  • Future recommendations include using a larger dataset and experimenting with reinforcement learning for further enhancements.

Conclusion and Resources 35:01

  • The workshop concludes with encouragement to experiment with trace generation and fine-tuning.
  • Resources and additional materials are available in the repository, along with suggested videos for deeper understanding of MCP setup and customization.