Blog

Posts

80 posts
Gymnasia: declaring reliable tools for OpenAI, Anthropic and Google

Gymnasia: declaring reliable tools for OpenAI, Anthropic and Google

How Gymnasia defines 13 tools in a canonical catalogue, adapts their JSON Schemas to OpenAI, Anthropic and Google, and prevents drift with c...

Gymnasia: architecture of an AI agent that runs on the phone

Gymnasia: architecture of an AI agent that runs on the phone

How the Gymnasia AI agent is built: a BYOK conversational coach with 13 local tools and a vision subagent that estimates macros from photos,...

Deep Research with LangGraph (3/3): the Writer agent and final report

Deep Research with LangGraph (3/3): the Writer agent and final report

Third and final part of the Deep Research with LangGraph series. Implement the Writer agent that drafts the final report from the research, ...

Deep Research with LangGraph (2/3): the multi-agent Research Supervisor

Deep Research with LangGraph (2/3): the multi-agent Research Supervisor

Second part of the Deep Research with LangGraph series. Build the Research Supervisor that coordinates several Researcher agents in parallel...

Build a Deep Research AI Agent with LangGraph (1/3)

Build a Deep Research AI Agent with LangGraph (1/3)

Build an AI research assistant with LangGraph. Part 1: system architecture, a Scope agent that clarifies the request, and a Researcher agent...

MCP Elicitation Tutorial: Human-in-the-Loop FastMCP

MCP Elicitation Tutorial: Human-in-the-Loop FastMCP

Build an interactive MCP server with FastMCP that collects user input in real time. Full Python example with elicit(), a confirmation tool, ...

MCP Durability: Persistence for Long Tasks

MCP Durability: Persistence for Long Tasks

Build durable MCP servers with SQLite persistence for long-running tasks. FastMCP tutorial with background task management and restart recov...

Resumable MCP: Automatic Checkpoints

Resumable MCP: Automatic Checkpoints

Build resumable MCP servers with automatic checkpoints using FastMCP. Handle task interruptions with state persistence and recovery for long...

FastMCP Streaming Tutorial: Progress Tracking & File Upload

FastMCP Streaming Tutorial: Progress Tracking & File Upload

FastMCP streaming tutorial: report_progress for long tasks, file upload with progress bars, and StreamableHttpTransport with Uvicorn. Full P...

LangGraph (4/4): state customization and checkpoints

LangGraph (4/4): state customization and checkpoints

Fourth and final part of the LangGraph guide. Customize the graph state with your own schemas and reducers, and master checkpoints to inspec...

LangGraph (3/4): long-term memory and human-in-the-loop

LangGraph (3/4): long-term memory and human-in-the-loop

Third part of the LangGraph guide. Implement long-term memory (across threads) so the agent remembers information between conversations, and...

LangGraph (2/4): short-term memory

LangGraph (2/4): short-term memory

Second part of the LangGraph guide. Add short-term memory to your chatbot: persist the graph state within a thread using checkpointers, reco...

LangGraph (1/4): basic chatbot and tools

LangGraph (1/4): basic chatbot and tools

Part 1 of the complete LangGraph guide: how it works, installing it, setting up API keys, and building your first chatbot with a state graph...

MCP with FastMCP (4/4): HTTP, authentication and the MCP client

MCP with FastMCP (4/4): HTTP, authentication and the MCP client

Fourth and final part of the MCP with FastMCP guide. Serve the server over HTTP, add authentication with Bearer tokens and RSA keys, and con...

MCP with FastMCP (3/4): advanced resources and prompts

MCP with FastMCP (3/4): advanced resources and prompts

Third part of the MCP with FastMCP guide. Add context to your resources, create parameterized resource templates, and define reusable prompt...

MCP with FastMCP (2/4): transport layer, context and resources

MCP with FastMCP (2/4): transport layer, context and resources

Second part of the MCP with FastMCP guide. Configure the transport layer, exclude tool arguments, access the request context, and create you...

MCP Tutorial with FastMCP: Your First Server (1/4)

MCP Tutorial with FastMCP: Your First Server (1/4)

Get started with the Model Context Protocol using FastMCP: build your first MCP server and expose functions as tools with @mcp.tool via a Gi...

AI Agent Patterns: Design & Architecture

AI Agent Patterns: Design & Architecture

Are your agents falling short? Elevate your AI projects with advanced patterns: ReAct, planning, multi-agents, and more. Practical guide wit...

LangGraph (1/4): basic chatbot and tools

LangGraph (1/4): basic chatbot and tools

Part 1 of the complete LangGraph guide: how it works, installing it, setting up API keys, and building your first chatbot with a state graph...

uv: Fast Alternative to conda and venv

uv: Fast Alternative to conda and venv

Discover uv, the Python package manager written in Rust. Create environments and install dependencies up to 100x faster than conda and venv.

FastRTC Tutorial: Real-Time Voice AI (STT + LLM + TTS)

FastRTC Tutorial: Real-Time Voice AI (STT + LLM + TTS)

Build a real-time voice assistant in Python with FastRTC: STT, LLM and TTS in one pipeline. From setup to phone-call integration, with full ...

Wan2.1-T2V-14B: Video Generation with HF

Wan2.1-T2V-14B: Video Generation with HF

Do you want to have your own Sora, but also generate good videos? In this post I explain how to do it with HuggingFace Inference Providers a...

Deploy backend with LLM in HuggingFace

Deploy backend with LLM in HuggingFace

Do you want to deploy a backend with your own LLM? In this post I explain how to do it with HuggingFace Spaces, FastAPI, Langchain and Docke...

Langchain with open source integrations

Langchain with open source integrations

Use LangChain with open-source integrations: ChromaDB, Ollama, and HuggingFace. Practical guide to building AI apps with free tools.

unittest in Python: Unit Testing Guide

unittest in Python: Unit Testing Guide

Python unittest tutorial: write unit tests, measure test coverage, and refactor confidently. Complete guide with practical examples using th...

RAG Fundamentals: Retrieval Augmented Gen

RAG Fundamentals: Retrieval Augmented Gen

Learn RAG fundamentals: build a retrieval-augmented generation system with Hugging Face and ChromaDB. Step-by-step question-answering tutori...

Conventional Commits: Git Standard Guide

Conventional Commits: Git Standard Guide

Learn Conventional Commits for clean Git history. Use commitizen and git-changelog to standardize commit messages and automate changelogs.

DoLa: Cut LLM Hallucinations by Contrasting Layers

DoLa: Cut LLM Hallucinations by Contrasting Layers

DoLa explained: decoding by contrasting layers boosts LLM factuality and cuts hallucinations, no retraining. Code examples with Hugging Face...

QLoRA Explained: NF4 Quantization & Paged Optimizers

QLoRA Explained: NF4 Quantization & Paged Optimizers

QLoRA paper explained: NF4 4-bit quantization, double quantization, and paged optimizers for efficient LLM fine-tuning. Practical BitsAndByt...

GPTQ Quantization Explained + GPTQConfig Tutorial

GPTQ Quantization Explained + GPTQConfig Tutorial

How GPTQ post-training quantization works for LLMs, explained from the paper. Hands-on GPTQConfig tutorial with Hugging Face: shrink models ...

llm.int8(): 8-bit Quantization for Transformers

llm.int8(): 8-bit Quantization for Transformers

Learn llm.int8() quantization to reduce LLM size without losing accuracy. Use 8-bit matrix multiplication with Transformers for efficient in...

LLM Quantization: Optimize Model Size

LLM Quantization: Optimize Model Size

Guide to LLM quantization: FP16, INT8, FP4, QLoRA, AWQ, GGUF, and more. Reduce model size for deployment on limited devices without losing a...

LoRA: Low-Rank Adaptation for LLMs

LoRA: Low-Rank Adaptation for LLMs

Learn LoRA (Low-Rank Adaptation) for efficient neural network fine-tuning with PyTorch. Adapt large models with minimal GPU resources and pr...

Fine-Tuning Florence-2: Computer Vision

Fine-Tuning Florence-2: Computer Vision

Step-by-step guide to fine-tuning Florence-2 multimodal model with PyTorch. Learn data preparation, hyperparameter setup, and vision-languag...

Fine-Tuning GPT-2 with Hugging Face Transformers & Trainer

Fine-Tuning GPT-2 with Hugging Face Transformers & Trainer

Step-by-step GPT-2 fine-tuning with Hugging Face Transformers: tokenizer text_target, DataCollatorForLanguageModeling, and Trainer. Complete...

GPT-2 Explained: Architecture, Model Sizes (124M–1.5B) & GPT2LMHeadModel

GPT-2 Explained: Architecture, Model Sizes (124M–1.5B) & GPT2LMHeadModel

GPT-2 paper explained: architecture, model sizes (124M, 355M, 774M, 1.5B parameters), and how to use GPT2LMHeadModel with Hugging Face Trans...

Florence-2: Multimodal Vision Model

Florence-2: Multimodal Vision Model

Explore Florence-2, Microsoft multimodal model with 200M-700M parameters that outperforms larger models. A versatile SOTA vision-language mo...

GPT-1: Generative Pre-Training for NLU

GPT-1: Generative Pre-Training for NLU

Deep dive into the GPT-1 paper: understand how generative pre-training works for NLP. Includes fine-tuning examples with Hugging Face and Py...

BPE Tokenizer: Subword Encoding Algorithm

BPE Tokenizer: Subword Encoding Algorithm

Understand BPE (Byte Pair Encoding) tokenization for NLP. Learn how this popular method splits text into tokens with step-by-step examples a...

Hugging Face Optimum: Fast Inference

Hugging Face Optimum: Fast Inference

Speed up PyTorch models with Hugging Face Optimum. Accelerate training and inference with ONNX Runtime optimization. Compatible with Transfo...

Ollama: Run LLMs Locally with Ease

Ollama: Run LLMs Locally with Ease

Run LLMs locally with Ollama. Use quantized language models on any machine with Docker-like simplicity. Fast inference with minimal memory r...

Accelerate: Saving, Mixed Precision and Inference (2/2)

Accelerate: Saving, Mixed Precision and Inference (2/2)

Save and load models with Hugging Face Accelerate, train with FP16/BF16/FP8 mixed precision, and run inference with the Hugging Face ecosyst...

Hugging Face Accelerate: Multi-GPU & TPU Training Guide

Hugging Face Accelerate: Multi-GPU & TPU Training Guide

Set up Hugging Face Accelerate and run your PyTorch training loop on multiple GPUs and TPUs. Step-by-step config, process control, and hands...

Hugging Face Evaluate: ML Metrics Guide

Hugging Face Evaluate: ML Metrics Guide

Master Hugging Face Evaluate library to measure NLP model performance. Automate metric calculations for accuracy, F1, BLEU, and more with pr...

Hugging Face Datasets: Data Management

Hugging Face Datasets: Data Management

Learn Hugging Face Datasets library: load, preprocess, and manage NLP datasets efficiently. Replace manual CSV handling with streamlined dat...

Hugging Face Transformers: NLP Models

Hugging Face Transformers: NLP Models

Complete Hugging Face Transformers guide: use pipeline, AutoModel, and fine-tuning for NLP tasks. Generate text, train models, and share on ...

git-sim: Visualize Git Commands

git-sim: Visualize Git Commands

git-sim tutorial: visually simulate Git commands before executing them. Test rebase, reset, merge, and more with graphical previews to avoid...

Hugging Face Tokenizers: Fast Encoding

Hugging Face Tokenizers: Fast Encoding

Guide to Hugging Face Tokenizers library: transform text into structured data for AI models. Practical Python examples for efficient NLP tok...

Transformers – from top to the bottom

Transformers – from top to the bottom

Discover transformers 🚀. Learn the architecture behind all the new language models. Don't ask an AI, come in and learn

ChromaDB Python Tutorial: Queries & Dimension Error Fix

ChromaDB Python Tutorial: Queries & Dimension Error Fix

ChromaDB in Python: create collections, query embeddings, and fix InvalidDimensionException. Hands-on guide with query_embeddings and hnsw:s...

Regular Expressions: Complete Guide

Regular Expressions: Complete Guide

Master regular expressions from basics to advanced techniques. Practical guide with Python examples for text search, extraction, and pattern...

CSS Tutorial: Flexbox, Grid & Web Design

CSS Tutorial: Flexbox, Grid & Web Design

Complete CSS guide covering selectors, properties, box model, layout, colors, and fonts. Practical examples for beginners and intermediate w...

Mixtral 8x7B: Mixture of Experts Model

Mixtral 8x7B: Mixture of Experts Model

Mixtral-8x7B guide: explore the Mixture of Experts architecture by Mistral AI. Learn how to use it with Hugging Face Transformers and Gradio...

Embedding Similarity: Distance Metrics

Embedding Similarity: Distance Metrics

Discover how similarity is measured between embeddings, the basis of the attention mechanism of transformers and RAG algorithms

Embeddings: Vector Representations in AI

Embeddings: Vector Representations in AI

Learn what embeddings are and how they work in NLP. Tutorial covering Word2Vec, GloVe, BERT, and Hugging Face Transformers with practical ex...

Tokens in NLP: Text Tokenization Guide

Tokens in NLP: Text Tokenization Guide

Learn what tokens are in NLP and how tokenization works. Understand OpenAI tiktoken, GPT-4, and text-embedding tokenizers with practical exa...

OpenAI API: Integration & Practical Guide

OpenAI API: Integration & Practical Guide

Complete OpenAI API tutorial: learn to use GPT for text generation, DALL-E for images, and more. Setup, installation, and practical Python e...

HTML Tutorial: Semantic Web Structure

HTML Tutorial: Semantic Web Structure

Learn HTML, the markup language used to create web pages. Learn how to structure the content of a web page and format it with HTML.

Fail2ban: Linux Server Protection

Fail2ban: Linux Server Protection

Fail2Ban tutorial: protect your Linux server from brute force attacks. Complete guide covering installation, configuration, and SSH security...

Caffeine: Prevent macOS Sleep Mode

Caffeine: Prevent macOS Sleep Mode

Install and use Caffeine on Ubuntu Linux to prevent sleep mode during long tasks. Simple setup guide to keep your system awake when you need...

Conda: Python Environment Management

Conda: Python Environment Management

Conda vs Pip comparison: manage Python packages and environments for data science. Learn Conda and Mamba for faster dependency resolution.

Git (3/3): remote repositories, stash and tags

Git (3/3): remote repositories, stash and tags

Third part of the Git guide. Work with remote repositories ☁️, create aliases, save changes with stash and mark versions with tags like a pr...

Git (2/3): branches

Git (2/3): branches

Second part of the Git guide. Master branches 🌳: create parallel lines of development, move between them, merge them and resolve conflicts ...

Git (1/3): local version control

Git (1/3): local version control

Have you rewritten that code that took you hours to do? Don't panic! First part of the Git guide: learn to keep version control of your proj...

Whisper: AI Audio Transcription by OpenAI

Whisper: AI Audio Transcription by OpenAI

👂 You don't get to gossip what the first one says? With whisper you can not only do it, but also translate it if you want. Log in and learn...

SSH Guide: Secure Remote Connections

SSH Guide: Secure Remote Connections

Complete SSH tutorial: establish encrypted connections to remote servers. Learn key generation, configuration, and advanced tips for secure ...

BLIP-2: Multimodal Vision-Language Model

BLIP-2: Multimodal Vision-Language Model

BLIP-2 tutorial: multimodal AI model that answers questions about images. Learn visual question answering and image captioning with practica...

Neural Networks: Linear Regression Step by Step

Neural Networks: Linear Regression Step by Step

Learn how a neural network works with Python: linear regression, loss function, gradient, and training. Hands-on tutorial with code.

Neural Networks: History and Key Milestones

Neural Networks: History and Key Milestones

Learn how neural networks work, their history since the 1950s, the AI Winter, and how ImageNet revolutionized AI in 2012. Beginner-friendly ...

Bash Scripting: Linux Automation Guide

Bash Scripting: Linux Automation Guide

Complete Bash scripting tutorial for Linux: learn variables, loops, conditionals, functions, and automation. Master the terminal from beginn...

Docker (2/2): Docker Compose and advanced topics

Docker (2/2): Docker Compose and advanced topics

🐳 Second part of the Docker guide. Orchestrate several containers at once with Docker Compose and master the advanced topics of Docker to t...

Docker (1/2): containers, images and applications

Docker (1/2): containers, images and applications

🐳 First part of the Docker guide. Create as many development environments as you want: learn to handle containers, data and volumes, images...

Terminal (3/3): system administration

Terminal (3/3): system administration

🟢 Third part of the terminal guide. Administer the system 🖥: memory, disk, packages, users, security and command scheduling in the termina...

Terminal (2/3): network, compression and processes

Terminal (2/3): network, compression and processes

🟢 Second part of the terminal guide. Master network utilities 🌐, file compression and managing background and foreground processes 💻 like...

Terminal (1/3): navigation, files and commands

Terminal (1/3): navigation, files and commands

🟢 First part of the terminal guide. Learn to move around the console 💻, handle files and directories, permissions, redirections, environme...

Data management with Pandas

Data management with Pandas

Complete Pandas tutorial: learn data analysis, manipulation, cleaning, and visualization in Python. Practical guide with real-world examples...

Matrix calculation with NumPy

Matrix calculation with NumPy

NumPy tutorial: master matrix operations, array manipulation, and scientific computing in Python. Complete guide with practical examples and...

Complete Python Guide 2025 (3/3): classes, objects and advanced topics

Complete Python Guide 2025 (3/3): classes, objects and advanced topics

Third part of the complete Python guide. Learn classes and objects, iterators, variable scope, modules and packages, error handling with try...

Complete Python Guide 2025 (2/3): operators, control flow and functions

Complete Python Guide 2025 (2/3): operators, control flow and functions

Second part of the complete Python guide. Master operators, control flow (if, for, while) and functions, including lambda, map, filter and r...

Complete Python Guide 2025 (1/3): data types

Complete Python Guide 2025 (1/3): data types

First part of the complete Python guide. Learn the data types: strings, numbers, sequences (lists and tuples), dictionaries, sets, booleans ...

Continue reading

Last posts -->

Have you seen these projects?

Gymnasia

Gymnasia Gymnasia
Expo
React Native
TypeScript
OpenAI
Anthropic

Fitness app with two agents that run entirely on the device, with no backend, so the user's data never leaves the phone. A BYOK conversational coach with adapters for OpenAI, Anthropic and Google, 12 local tools and a remote system prompt with offline fallback, plus a vision subagent that estimates macronutrients from food photos, with barcode scanning against OpenFoodFacts.

LangGraph Deep Researcher

LangGraph Deep Researcher LangGraph Deep Researcher
Python
LangGraph
FastAPI
React
TypeScript
Docker

Multi-agent research system built with LangGraph. A supervisor breaks your question down into topics and launches search sub-agents in parallel; each one compresses its findings before handing them to a writer agent that produces the final sourced markdown report. Live streaming over WebSockets, a configurable model per role and bring-your-own API keys that are never persisted server-side.

Tau

Tau Tau
Python
LangChain

Multi-agent tutoring system for secondary school students, with one agent per subject and course material written and validated by a team of teachers. It was used with real students at a private school in Spain and at a secondary school in Colombia.

View all projects -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to watch any talk?

Last talks -->

Do you want to improve with these tips?

Last tips -->

Use this locally

Hugging Face spaces allow us to run models with very simple demos, but what if the demo breaks? Or if the user deletes it? That's why I've created docker containers with some interesting spaces, to be able to use them locally, whatever happens. In fact, if you click on any project view button, it may take you to a space that doesn't work.

Flow edit

Flow edit Flow edit

FLUX.1-RealismLora

FLUX.1-RealismLora FLUX.1-RealismLora
View all containers -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to train your model with these datasets?

short-jokes-dataset

HuggingFace

Dataset with jokes in English

Use: Fine-tuning text generation models for humor

231K rows 2 columns 45 MB
View on HuggingFace →

opus100

HuggingFace

Dataset with translations from English to Spanish

Use: Training English-Spanish translation models

1M rows 2 columns 210 MB
View on HuggingFace →

netflix_titles

HuggingFace

Dataset with Netflix movies and series

Use: Netflix catalog analysis and recommendation systems

8.8K rows 12 columns 3.5 MB
View on HuggingFace →
View more datasets -->