| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 2547 |
| Technical Name |
llm_tool |
| License | LGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
| Versions | 16.0 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 2547 |
| Technical Name |
llm_tool |
| License | LGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
| Versions | 16.0 18.0 |
LLM Tool
Automate your Odoo database with AI-powered function calling.
Enable AI models to execute actions in your Odoo system
What is LLM Tool?
AI-powered automation for your Odoo database
This module provides a robust framework for integrating Large Language Models (LLMs) with Odoo through function calling. Enable AI models to execute specific functions based on user requests, automate workflows, and interact with your Odoo data intelligently.
Key Features
Everything you need for AI-powered automation
Function Calling
Enable AI models to call specific functions based on user requests, automating complex tasks.
Tool Management
Define and manage LLM tools with custom implementations and automatic schema generation.
Dynamic Schema Generation
Automatically generate JSON schemas from Python type hints for seamless integration.
Flexible Override Options
Override tool descriptions and schemas for custom implementations and legacy code.
Chat Integration
Seamless integration with Odoo mail threads for intelligent chat interactions.
Extensible Design
Add new tool implementations for your business needs with the @llm_tool decorator.
Technical Details
Requirements and dependencies
Module Information
LLM Tool
AI
base, mail, llm
LGPL-3
Installation
- Download the module from the Odoo Store or GitHub
- Install dependencies:
base,mail,llm - Upload and install the module in your Odoo instance
Related Modules
Build your complete AI automation stack
LLM Tool - AI Function Calling
Enable LLMs (ChatGPT, Claude, etc.) to interact with your Odoo database by calling tools/functions.
Module Type: 📦 Infrastructure
Installation
What to Install
This module is typically auto-installed as a dependency of llm_assistant or llm_thread.
For AI with function calling:
odoo-bin -d your_db -i llm_assistant,llm_openai
Auto-Installed Dependencies
These are pulled in automatically:
- llm (core infrastructure)
Optional Enhancements
| Module | Adds |
|---|---|
| llm_tool_demo | 6 example tools to learn from | |
| llm_tool_knowledge | RAG search tool for LLMs | |
| ``llm_tool_ocr_mistral``| OCR tool using Mistral | |
Common Setups
| I want to... | Install |
|---|---|
| AI that searches Odoo records | llm_assistant + llm_openai |
| AI that searches documents | Above + llm_knowledge + llm_tool_knowledge |
| Expose tools to Claude Desktop | Above + llm_mcp_server |
| Learn to build custom tools | llm_tool_demo |
Quick Start for Developers
Using the @llm_tool Decorator (Recommended)
Zero boilerplate - just decorate your method and it's automatically available to LLMs.
from odoo import models from odoo.addons.llm_tool.decorators import llm_tool class ResUsers(models.Model): _inherit = "res.users" @llm_tool(read_only_hint=True, idempotent_hint=True) def get_system_info(self) -> dict: """Get basic Odoo system information""" return { "database_name": self.env.cr.dbname, "company_name": self.env.company.name, "user_count": self.env["res.users"].search_count([]), }
That's it! The tool is automatically:
- Registered in the database when Odoo starts
- Available to all LLM providers (Claude, ChatGPT, etc.)
- Description extracted from docstring
- Schema generated from type hints
- Validated with Pydantic
Decorator Options
@llm_tool( schema={...}, # Optional: Manual JSON schema read_only_hint=True, # Tool only reads data idempotent_hint=True, # Multiple calls have same effect destructive_hint=False, # Tool modifies/deletes data open_world_hint=False, # Tool interacts with external systems ) def your_tool_method(self, param1: str, param2: int = 10) -> dict: """Tool description - shown to the LLM""" pass
Using Custom Implementation
For tools managed via XML data files, extend llm.tool:
class LLMTool(models.Model): _inherit = "llm.tool" @api.model def _get_available_implementations(self): implementations = super()._get_available_implementations() implementations.append(("my_custom_tool", "My Custom Tool")) return implementations def my_custom_tool_execute(self, param1, param2=None): """Execute your custom tool logic""" return {"result": "success"}
Then create tool records in XML:
<record id="my_custom_tool" model="llm.tool"> <field name="name">my_custom_tool</field> <field name="implementation">my_custom_tool</field> <field name="description">Tool description for the LLM</field> <field name="input_schema">{"type": "object", "properties": {...}}</field> </record>
Built-in Implementations
- odoo_record_retriever - Search and retrieve Odoo records
- odoo_record_creator - Create new records
- odoo_record_updater - Update existing records
- odoo_record_unlinker - Delete records
- odoo_model_method_executor - Execute any model method
- odoo_model_inspector - Inspect model structure and fields
How Tools Work
- LLM Receives Tool Definitions - When chatting, the LLM gets available tools with schemas
- LLM Decides to Call Tool - Based on user request, LLM chooses which tool to call
- Odoo Executes Tool - Parameters are validated and the tool method is executed
- Result Returned to LLM - Tool output is sent back to formulate a response
Tool Security
requires_user_consent = True # User must approve before execution read_only_hint = True # Tool only reads, doesn't modify destructive_hint = True # Tool may modify/delete data
Configure consent rules in: LLM → Configuration → Tool Consent Configs
Testing Your Tools
# In Odoo shell or tests tool = env["llm.tool"].search([("name", "=", "your_tool_name")]) result = tool.execute({"param1": "value1", "param2": 42}) print(result)
Technical Specifications
Module Information
- Name: LLM Tool
- Version: 18.0.3.0.0
- Category: Technical
- License: LGPL-3
- Dependencies: llm
- Author: Apexive Solutions LLC
Key Models
- ``llm.tool``: Tool definition and execution
- ``llm.tool.consent.config``: User consent configuration
Resources
- GitHub Repository
- Decorator Guide
- Changelog
License
This module is licensed under LGPL-3.
© 2025 Apexive Solutions LLC. All rights reserved.
Please log in to comment on this module