A hands-on workshop demonstrating how to fine-tune Ministral 8B for specialized tasks, deploy models efficiently using LoRA adapters on Amazon SageMaker, and build intelligent multi-agent systems with Strands for automated data analysis and visualization.
This workshop guides you through the end-to-end lifecycle of AI systems from model fine-tuning to deployment and orchestration. You'll work with product sales data to create a multi-agent system that can understand natural language queries, generate SQL, and produce visualizations automatically.
Duration: 2-3 hours
Platform: Workshop Studio (all resources provided)
- Fine-tuned SLM Models: Two specialized Ministral 8B models using LoRA (Low-Rank Adaptation)
- Text-to-SQL model for database querying
- Text-to-Python model for Matplotlib visualization generation
- Efficient Deployment: Single base model endpoint with 2 LoRA adapters on Amazon SageMaker
- Multi-Agent System: Strands-powered orchestration that converts natural language to insights
All resources are provisioned through Workshop Studio, including:
- AWS Account with appropriate permissions
- Amazon SageMaker Studio environment
- Pre-configured IAM roles
- Product sales dataset with schema
- Ministral 8B: Base small language model
- LoRA (Low-Rank Adaptation): Efficient fine-tuning technique
- Amazon SageMaker: Model training and deployment platform
- Strands: Multi-agent orchestration framework
- SQL & Python/Matplotlib: Target output formats
Fine-tune two LoRA adapters for specialized tasks:
1-NL2SQL.ipynb— Fine-tune for Text-to-SQL generation2-NL2Py.ipynb— Fine-tune for Text-to-Python/Matplotlib generation
Deploy both adapters on a single SageMaker endpoint and evaluate performance:
1-deploy-and-benchmark.ipynb— Deploy with vLLM, attach LoRA adapters, benchmark against Bedrock LLMs
Create an intelligent orchestration layer that combines your models:
1-multi-agent-setup.ipynb— Build and test the complete multi-agent system
Key Concepts Covered:
- Strands
@tooldecorator for creating agent tools - Agents-as-tools pattern: Wrapping specialized agents as tools for a supervisor
- Multi-agent orchestration with Claude Haiku 4.5 as the reasoning layer
- SageMaker inference components for serving multiple LoRA adapters
Architecture:
| Agent | Model | Role |
|---|---|---|
| Supervisor | Claude Haiku 4.5 (Bedrock) | Orchestrates workflow, executes SQL, manages data flow |
| SQL Agent | NL2SQL (fine-tuned SLM) | Converts natural language → SQL queries |
| Python Agent | NL2Py (fine-tuned SLM) | Generates Matplotlib visualization code |
slm-agentic-workshop/
├── lab1/ # Fine-tuning LoRA adapters
│ ├── 1-NL2SQL.ipynb
│ ├── 2-NL2Py.ipynb
│ └── scripts/
│ ├── train.py
│ └── requirements.txt
├── lab2/ # Deployment + benchmarking
│ └── 1-deploy-and-benchmark.ipynb
├── lab3/ # Multi-agent system
│ └── 1-multi-agent-setup.ipynb
├── assets/ # Datasets and diagrams
│ ├── cosmetics_sales_synthetic_data.csv
│ ├── training_samples_120.csv
│ ├── training_dataset_matplotlib_30_v2.csv
│ ├── benchmark_samples.csv
│ ├── sample_product_sales.csv
│ └── agent-slm.png
├── requirements.txt # Shared dependencies
└── README.md
This is sample code, for non-production usage. You should work with your security and legal teams to meet your organizational security, regulatory and compliance requirements before deployment.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.
