DBeaver Proxy to Mistral
A small FastAPI proxy that makes DBeaver CE (and other OpenAI-compatible clients) work with the Mistral API.

About DBeaver Proxy to Mistral
DBeaver Proxy to Mistral is a small FastAPI proxy that makes DBeaver CE (and other OpenAI-compatible clients) work with the Mistral API.
DBeaver's AI assistant speaks an OpenAI-like API, but it expects some very specific JSON fields and SSE event types. This proxy:
- Exposes OpenAI-compatible endpoints (
/responses,/models, legacy/chat/completions) - Translates
POST /responses(OpenAI Responses API shape used by DBeaver) into MistralPOST /chat/completions - Translates Mistral responses back to a payload that DBeaver can parse without
NullPointerException - Supports streaming (Server-Sent Events) and non-streaming
- Is configurable via environment variables and can run as a systemd service

Supported Endpoints
The proxy exposes the following endpoints (both root and /v1/* aliases where applicable):
Model Endpoints
GET /modelsGET /v1/models
Returns a list of advertised models (configured via MISTRAL_MODELS).
Response Endpoints
POST /responsesPOST /v1/responses
Accepts a DBeaver/OpenAI Responses API request and forwards it to Mistral chat/completions.
Legacy Endpoints
POST /chat/completionsPOST /v1/chat/completions
Legacy pass-through to Mistral chat/completions (no format conversion).
Configuration
Configuration is done via environment variables. You can use a local .env file (loaded via python-dotenv) or set variables in your shell/systemd environment.
Environment Variables
Required
MISTRAL_API_KEY
Optional
MISTRAL_BASE_URL- Default:https://api.mistral.ai/v1MISTRAL_MODEL- Default:mistral-large-latest(used when request doesn't specify a model)MISTRAL_MODELS- Comma-separated list of model ids that the proxy will advertise viaGET /modelsHOST- Default:0.0.0.0PORT- Default:60916REQUEST_TIMEOUT_SECONDS- Default:60
Configuration Notes
GET /modelsworks even ifMISTRAL_API_KEYis not set- Any route that calls the Mistral API (
/responses,/chat/completions) will return 401 ifMISTRAL_API_KEYis missing
Local Development
Requirements
- Python 3.12+
Setup
Configure
Run
The server will listen on http://0.0.0.0:60916 by default.
Lint & Test
Using with DBeaver
In DBeaver CE:
- Set the OpenAI endpoint/base URL to:
http://<your-server>:60916/v1/ - Set any token value (DBeaver requires one), but the proxy uses
MISTRAL_API_KEYfrom the server environment
DBeaver uses:
GET /v1/modelsPOST /v1/responses
Systemd Service
This repo includes an example unit file and env file template:
deploy/systemd/dbeaver-mistral-proxy.servicedeploy/systemd/dbeaver-mistral-proxy.env.example
Install
- Create a virtualenv and install deps (see Local development)
- Create the environment file used by the service:
- Install the unit file:
Logs
Docker
This project can run as a lightweight container.
Build
Run (Docker)
Docker Compose
Versioning and Releases
This project uses Semantic Versioning (SemVer) and Conventional Commits. Releases are automated via python-semantic-release in GitHub Actions.
How it Works
- A push to
maintriggers the release workflow python-semantic-releaseanalyzes commit messages and determines the next version- If a release is created, it:
- Creates a Git tag in the format
vX.Y.Z - Updates
project.versioninpyproject.toml - Generates
CHANGELOG.mdfrom templates - Publishes Docker images tagged with
latestandvX.Y.Z
- Creates a Git tag in the format
Conventional Commits Examples
feat(proxy): add tool_choice forwarding-> minor bumpfix(api): handle gzip bodies-> patch bumpperf(proxy): reduce allocations-> patch bumpdocs: update readme-> no version bump
Breaking Changes
Include BREAKING CHANGE: in the commit body to trigger a major bump.
GitHub Actions Secrets
GITHUB_TOKEN- Provided automatically by GitHubRELEASE_TOKEN(optional) - PAT with permissions to push commits/tagsDOCKERHUB_USERNAME(optional)DOCKERHUB_TOKEN(optional)
Publishing Notes
- GHCR publish uses
github.tokenand runs when a release is created - Docker Hub publish runs only when
DOCKERHUB_USERNAMEandDOCKERHUB_TOKENare set
Troubleshooting
DBeaver Error: "HTTP/1.1 header parser received no bytes" / "Connection reset"
This generally indicates the proxy failed before writing a response.
Mitigations implemented:
- Robust request parsing for
/responsesand/chat/completions - Handles empty bodies and
Content-Encoding: gzip - Uvicorn forced to use the
h11HTTP implementation for better compatibility
Debugging:
"Unsupported upgrade request" in logs
This can happen when a client attempts an upgrade (e.g. h2c/websocket-style upgrades). It is expected and harmless for normal DBeaver usage.
Technology Stack
- Python 3.12+ with FastAPI for the proxy server
- Mistral AI API integration for AI completions
- DBeaver CE compatibility layer
- Docker for containerized deployment
- Systemd for Linux service management
- Semantic Versioning with Conventional Commits for automated releases
DBeaver Proxy to Mistral provides a seamless bridge between DBeaver's OpenAI-compatible API expectations and the Mistral API, enabling developers to use Mistral's AI capabilities directly within DBeaver CE.