Skip to Content

Odoo ❤️ Hugging Face: Unleash AI Power with Seamless Integration

Integrating Hugging Face Models into Odoo 18 for Next-Level AI
Odoo integrated with the Hugging Face logo

Odoo HuggingFace MCP Integration 🤗

A comprehensive AI integration module for Odoo 18 that connects to HuggingFace Spaces through the Model Context Protocol (MCP), providing advanced AI capabilities directly within the Odoo interface.

🚀 Features

Core AI Capabilities

  • 🎭 Sentiment Analysis: Real-time emotion and tone analysis using RoBERTa models
  • 🌍 Translation: Multi-language translation with Helsinki-NLP models (including Gujarati!)
  • 🎨 Image Generation: High-quality image creation using FLUX.1-schnell
  • 👁️ OCR/Vision: Text extraction from images and PDFs using Nanonets OCR
  • 📝 Text Summarization: Intelligent content summarization with BART models
  • 💬 Chat/Conversation: Advanced AI chat using Qwen 2.5 72B model
  • 🔊 Text-to-Speech: Audio generation using Parler TTS (Future Enhancement)
  • 🎤 Speech-to-Text: Audio transcription using Whisper models (Future Enhancement)

Integration Features

  • 📱 Chatter Integration: AI buttons in all message composers
  • 📎 Automatic File Detection: OCR processes attached images automatically
  • 🔄 Dual-Mode Operation: MCP server + LLM fallback for reliability
  • 🔐 Secure Configuration: Environment-based API key management
  • 📊 Result Tracking: Complete audit trail with processing times

Direct Hugging Face Integration

The integration adds Hugging Face as a provider type within Odoo's LLM (Large Language Model) framework. This allows direct connection to Hugging Face models using API endpoints and API keys. You can easily test the connectivity and interact with the models directly from within Odoo.

This module builds upon an existing LLM provider module, adding Hugging Face functionality. It supports various tools provided by Hugging Face, including:

  • Chat with custom models (e.g., Llama 3B, 8B)
  • Image to Text
  • OCR (Optical Character Recognition)
  • Sentiment Analysis
  • Summarization
  • Image Generation
  • Translation

These tasks are dynamically configurable, allowing you to integrate Gradient Spaces or direct API endpoints. The configuration includes arguments specific to each provider.

A custom space can be created with reference to API points as private, but direct API endpoints can also be utilized for tasks like language translation and summarization.

Tasks are configured initially at the configuration level and results are automatically generated as a historic record.

Chatter Integration for Quick Tasks

The module provides a direct chatter integration for sentiment analysis, text translation, summarization, and AI chat. These tasks can be performed directly from any Odoo model with chatter integration.

Examples include:

  • Sentiment analysis of a statement.
  • Translation of a statement into another language (demonstrated with Gujarati).
  • Summarization of longer text passages.
  • Chatting with an AI agent to compare Odoo OWL and ReactJS frameworks.

Dedicated Dashboard for Image and OCR Processing

A dedicated dashboard provides tools for OCR and image generation. OCR supports PDF and image extraction. The dashboard tracks processing status and results.

Image generation is also supported. Example: "Create a rainy cloud environment with an Indian forest and show a small home with yellow color where a cat is sitting."

Agent Configuration and Model Selection

The module utilizes an agent based on Pydantic for AI task processing, allowing you to specify the main provider and an alternative provider. You can test your agent directly from the configuration.

This setup allows for automated fallback, for example main agent uses the Qwen Hugging Face provider model while the alternative is the OpenAI GPT mini 4.0.

Ongoing Development

Future work includes integrating an MCP server directly into Odoo and enhancing model capabilities. The project is also exploring integrating different cloud services for loading tools directly.

Demo URL: https://youtu.be/kVsPI5i_NFA

Share this post
Unlock Odoo Insights: Build Your Custom Dashboard!
Create custom views for better business decisions.