Connect an AI provider (admin)
This page shows how to connect MailDesk Pro to an AI provider, test the connection and switch AI on for a mailbox. You do this once. Your colleagues do not enter keys.
Who this is for: the MailDesk administrator, with help from the Odoo/system administrator for the Python packages. You need: MailDesk Pro installed, the MailDesk administrator role, and either an API key from a cloud provider or an OpenAI-compatible server you run yourself.
Before you begin
- MailDesk Pro is installed and licensed. See Plans and included features.
- The Python package for your provider is installed on the Odoo server (next section).
- The Odoo server can reach the provider. A cloud provider needs outbound internet access. A local server must be reachable from the Odoo server, not only from your laptop.
- You have the API key from the provider (not needed for a local server).
- You have read Data sent to the AI provider, so you know what leaves your system.
Which providers you can use
| Provider (label in MailDesk) | Notes |
|---|---|
| OpenAI (ChatGPT) | Uses the OpenAI Python package |
| Google Gemini | Uses the Google GenAI Python package |
| Anthropic Claude | Uses the Anthropic Python package |
| xAI Grok | Uses the OpenAI Python package |
| DeepSeek | Uses the OpenAI Python package |
| Custom / Local Server | Your own OpenAI-compatible server, for example Ollama, LM Studio or vLLM |
Install the provider package (Odoo/system administrator)
The AI packages ship in a requirements.txt file of the Pro module folder. Odoo does not install them for you.
| Package | Version in Pro's requirements.txt |
Needed for |
|---|---|---|
openai |
>=1.55.3,<2 |
OpenAI, xAI Grok, DeepSeek, Custom / Local Server |
google-genai |
==1.0.0 |
Google Gemini |
anthropic |
>=0.40 |
Anthropic Claude |
google-auth |
<2.48.0 |
Shared Google sign-in library; keep it within this range |
Install only the packages for the provider you use. Use the same Python environment that runs Odoo, then restart Odoo.
- Own server: install the packages with
pipinto the Odoo environment from therequirements.txtin the Pro module folder. - Odoo.sh: put the packages into the
requirements.txtat the root of your repository (or in the folder that contains your modules). Odoo.sh does not read arequirements.txtinside a module folder.
If a package is missing
MailDesk loads the package when AI first runs. If it is missing, the error names the package. Install it and restart Odoo.
Step 1 - Open the AI Providers list
- Go to MailDesk ▸ Configuration ▸ MailDesk Settings ▸ AI Providers.
- Click New.
What you should see: the list with the columns Name, Provider, Model, Key Set, Connectivity and Active.
Step 2 - Choose the provider and model
- Enter a Name you will recognise, for example "GPT-4o Production".
- Choose the Provider.
- Optional: enter the Model ID, exactly as the provider names it. If you leave it empty, MailDesk uses the default below.
| Provider | Default model | Other models named in the form help |
|---|---|---|
| OpenAI (ChatGPT) | gpt-4o |
gpt-4o-mini, gpt-4.1, gpt-4.1-mini |
| Google Gemini | gemini-2.5-flash |
gemini-2.5-pro |
| Anthropic Claude | claude-sonnet-4-6 |
claude-opus-4-7, claude-haiku-4-5-20251001 |
| xAI Grok | grok-4.20-0309-non-reasoning |
grok-4.20-0309-reasoning |
| DeepSeek | deepseek-chat |
deepseek-reasoner |
| Custom / Local Server | (none) | Enter the name your server uses |
Provider model names change over time. If a model is retired, enter a current Model ID from your provider.
Step 3 - Enter the API key
- Click Set API Key.
- Paste the key and click Save Key.
What you should see: API Key Configured is ticked on the record. MailDesk does not show the key again.
Keep your own copy of the key
You cannot read a saved key back in MailDesk. The key is stored in Odoo's system parameters. To replace it, open Set API Key again. To remove it, use Clear Stored Key in the same window.
The Set API Key button is not shown for Custom / Local Server. A custom server is used without a key.
Step 4 - Make it the active provider
- Open the provider and click Set as Active. In the list you can also click Set Active in the row.
- Only one provider is active at a time. Activating one switches the others off.
Step 5 - Test the connection
- Click Test Connection.
What you should see: a Connected notification, and the Connectivity badge changes to Connected. If the test fails, you see Connection Failed with the reason, and the badge shows Error. The usual causes are a wrong key, a wrong Model ID or a blocked network path. See Fix AI setup and feature problems.
Step 6 - Switch AI on for a mailbox
- Go to MailDesk ▸ Configuration ▸ Mailboxes ▸ Mailbox Accounts and open the mailbox.
- Make sure Enable AI features is switched on. It is on by default.
- Decide on Automatic AI summaries. When on (default), MailDesk summarizes new unread Inbox mail in the background. See Data sent to the AI provider.
- Optional: open the AI Settings tab. Set Default Reply Tone (Professional, Formal, Friendly & Warm, Technical & Precise or Concise) and Team / Mailbox Context, a short description of your team that the AI uses as background.
What you should see: in an opened email, the AI panel works. In Safe Mode, Check with AI appears for that mailbox.
Attachment analysis is a separate opt-in and is off by default. This version does not show it on the mailbox form.
Keep everything on your own network (local server)
Choose Custom / Local Server if email content must not go to a third party.
- Create a provider and choose Custom / Local Server.
- Enter the Base URL of your OpenAI-compatible server. It is required. It is normally the server address ending in
/v1. Examples: Ollamahttp://localhost:11434/v1, LM Studiohttp://localhost:1234/v1, vLLMhttp://localhost:8000/v1. - Enter the Model ID exactly as your server exposes it, for example
llama3.2. - Click Set as Active, then Test Connection.
localhost means the Odoo server
The address is opened by the Odoo server. localhost is the Odoo server itself, not your computer. Use an address the Odoo server can reach.
Use different providers for different tasks (optional)
By default every task uses the active provider. To change that, go to MailDesk ▸ Configuration ▸ MailDesk Settings ▸ Settings and open the AI Providers (PRO) block.
| Setting | What it controls |
|---|---|
| Security Scan Provider | The Check with AI result |
| Thread Summary Provider | Thread summaries |
| Reply Draft Provider | Draft a reply |
| Ask AI / Editor Provider | The Ask AI dialog in the HTML editor |
Leave a setting on — Use active provider — to use the active provider. In the same block, Background AI Enrichment turns the background summaries off for the whole system.
Turn AI off
- One mailbox: switch Enable AI features off on the mailbox account. Switch only Automatic AI summaries off to keep the panel but stop the background work.
- Background summaries, all mailboxes: switch Background AI Enrichment off in MailDesk Settings ▸ Settings.
- All AI, or one feature: these switches are system parameters (
maildesk.ai.enabledandmaildesk.ai.feature.<feature>.enabled). Set the value to0in Settings ▸ Technical ▸ System Parameters (developer mode). There is no screen for them in MailDesk. - Remove a provider: delete the provider record. To remove only the key, use Clear Stored Key.
If it does not work
| What you see | What to check | Next step |
|---|---|---|
| Connection Failed | Key, Model ID, network path from the Odoo server | Fix the value and test again. See Fix AI setup and feature problems |
| Error names a missing package | Python package for the provider | Install it in the Odoo environment and restart Odoo |
| The AI panel shows AI is not set up yet | No active provider | Complete Step 4 |
Next step: Data sent to the AI provider.