A LiteLLM proxy server with built-in message sanitization for Mistral models.
This is very handy when self-hosting Devstral 2 or other Mistral models using llama.cpp.
- Mistral Message Sanitization: Automatically enforces Mistral's conversation template constraints:
- Maximum one system message at the start
- Strictly alternating user/assistant roles (squashes consecutive messages)
- Proxy Server: Built on LiteLLM's proxy functionality
- API Key Authentication: Secure your proxy with API keys
- Environment Configuration: Easy setup via environment variables
- Python 3.13
- uv (recommended for dependency management)
- Check out the repository
- Install dependencies using uv:
uv sync
Create a .env file based on .env.example.
# Start the proxy server
./start.sh