AI Base (BytesRaw)
Reusable AI connectivity layer: connections, provider adapters, usage logging
One registry for every provider.
One place for every cost.
AI Base is the connectivity foundation of the BytesRaw AI suite for Odoo 19 Community. It gives your database a single place to declare which AI providers you use, what they cost, and how much they are allowed to spend โ and it records every call they make.
One provider record covers Claude, any OpenAI-compatible gateway (OpenRouter, Groq, DeepSeek, vLLM, LM Studio, Azure) and a local Ollama server. Every other BytesRaw AI module reads its credentials from here, so keys, endpoints and budgets are configured once and never duplicated across screens.
One Registry, Three Provider Families
Add a provider, pick the API dialect, and the base URL fills itself in. Claude speaks the Anthropic Messages API, the OpenAI-compatible dialect covers most hosted gateways, and Ollama covers models running on your own hardware โ all behind the same form.
Cost Estimation and Daily Budgets
Enter what your provider bills per million input and output tokens and every call is priced as it happens. Set a daily token budget and the provider stops accepting calls once it is exhausted, with warning banners at 80% and a hard block at 100%.
A Full Audit Trail
Every completion, embedding, transcription and image generation writes a usage row โ tokens, cached tokens, estimated cost, latency, the model, the user and the calling agent โ viewable as a list, bar chart or pivot table.
Connect once.
Measure everything.
Nine capabilities covering connectivity, cost control and observability โ with no third-party Python SDK to install.
Multi-Provider Connections
Create as many providers as you need, each with its own base URL, API key, chat model, embedding model and image model. Reorder them with drag handles, archive the ones you are not using, and scope them per company or share them across all companies.
Test Connection and Fetch Models
Test Connection sends a live probe and reports the model that answered, flipping the status badge to Tested or Error with the exact failure message kept on the Status tab. Fetch Models lists the model ids the provider currently exposes, so you copy the right one instead of guessing.
Manager-Only Credentials
API keys live behind the AI / Manager privilege and are masked in the form. Regular AI users can run completions through a provider without ever being able to read the secret โ the key is resolved server-side at call time.
Per-Model Pricing Overrides
Connection-level prices are the default, but a single gateway often serves models at very different rates. Per-model prices can be declared in the providerโs extra parameters, and cached input tokens are billed at the discounted rate providers actually charge for them.
Daily Token Budget with Clean Failover
A provider that has burned its daily allowance fails fatally rather than retrying โ exactly what an agentโs failover chain needs to skip straight to the next provider instead of hammering an exhausted account. The block itself is audited as a zero-token error row.
Automatic Retry on Transient Errors
Timeouts, rate-limit responses and 5xx errors are retried with exponential backoff up to the per-connection retry count. Errors are classified as retryable or fatal so the higher layers know the difference between โtry againโ and โmove onโ.
Declared Media Capabilities
Each provider declares which attachment kinds it accepts โ images, PDFs, audio, plain text. Sensible per-provider defaults apply out of the box and can be overridden per connection, for example to switch vision on for an Ollama connection running a vision model.
Usage Analytics and Retention
The Usage Logs view groups by connection, provider, model, agent, user, status or day, with token and cost totals summed in the list and plotted in graph and pivot views. Logs older than the retention window (90 days by default) are cleared automatically by autovacuum.
Endpoint Rate Limiting
Public-facing AI surfaces are protected by a sliding-window rate limiter stored in the database, so the limit holds across all Odoo workers instead of being multiplied by them. Limits and windows are adjustable per surface through system parameters.
One form, six fields, done.
Configure at least one provider before installing or using any other BytesRaw AI module.
Grant access
Give users the AI / User privilege to run AI features, or AI / Manager to configure providers and see credentials.
Open the provider list
Navigate to AI โ Configuration โ AI Providers and click New.
Pick the provider type
Choose Claude, OpenAI Compatible or Ollama. The Base URL fills from the provider default and stays editable.
Enter credentials and models
Paste the API Key (not needed for Ollama), then set the default chat, embedding and image models.
Set prices and a budget
On Pricing & Budget, fill the two per-million-token prices and, optionally, a Daily Token Budget.
Tune the advanced tab
Request timeout, retries, declared supported media, and free-form extra parameters for provider-specific options.
Test it
Click Test Connection. A green notification naming the answering model confirms the setup.
Watch the spend
Open AI โ Configuration โ Usage Logs and group by model, agent or day.
See it in action
Where providers are configured, and how their consumption is reported back to you.
From zero to a working provider
Three workflows: connect a provider, cap what it can spend, and run several side by side.
Connect Your First Provider
Get a working AI provider into Odoo so the rest of the suite has something to call.
Put a Ceiling on AI Spending
Make AI consumption predictable before rolling it out to a wider group of users.
Run Several Providers Side by Side
Combine a premium provider with a cheap or local one and let the agent layer pick.
Full transparency
The current limitations, stated plainly.
Media capabilities are declared, not probed
The module assumes hosted Claude and OpenAI-compatible gateways handle images, that every provider can be given a PDF (falling back to extracted text), and that only OpenAI-compatible gateways transcribe audio. If your setup differs, set supports_vision, supports_pdf, supports_audio or supports_image_generation to true/false in the connectionโs Extra Parameters.
Costs are estimates, not invoices
Figures are calculated at log time from the prices you enter, not pulled from the provider. They are frozen on each row, so correcting a price later does not rewrite history โ which is intentional, but means old rows keep the old estimate.
Budgets are per UTC day, per connection
Token budgets are counted per UTC day rather than per local business day, and are evaluated per connection rather than across a group of connections.
Questions, answered
Quick answers to the questions buyers ask most.
Which AI providers can I connect?
Anthropic Claude via the Messages API, any service exposing an OpenAI-compatible /chat/completions endpoint (OpenRouter, Groq, DeepSeek, Together, vLLM, LM Studio, Azure OpenAI), and Ollama running locally or on your own server.
Do I need to install any Python SDK?
No. The provider adapters are pure Python over requests, which already ships with Odoo. There is nothing to pip install.
Can this module be used on its own?
Yes. Installed alone it gives you a provider registry, cost tracking and usage analytics, and exposes a stable client API your own custom module can call for chat completions, embeddings, streaming, transcription and image generation.
Who can see the API keys?
Only members of the AI / Manager privilege. Users with AI / User can trigger AI features that use a provider, but the key is never sent to their browser.
Will it conflict with other AI apps I have installed?
No. Every module, model and table in the suite carries the bytesraw suffix, so it coexists cleanly with OCA ai_* add-ons or Odoo Enterprise AI features.
How long is usage history kept?
90 days by default, then cleared by Odooโs autovacuum. Change the window with the ai_base_bytesraw.usage_log_retention_days system parameter, or set it to 0 to keep everything.
Release history
A clean record of every release.
Bytesraw
๐ ๏ธ Need help?
Got a question, found a bug, or need a custom enhancement? Our support team responds within 24 hours on business days.
help@bytesraw.com โ๐ผ Custom development
Need this module tailored to your workflow, or a brand-new Odoo solution? Letโs talk about your project.
info@bytesraw.com โ| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1730 |
| Technical Name |
ai_base_bytesraw |
| License | OPL-1 |
| Website | https://www.bytesraw.com |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module