이 페이지는 아직 사용자의 언어로 번역되지 않았거나 번역이 기술 검토를 기다리고 있습니다. 아래에는 영어 원문이 표시됩니다. 영어 페이지 열기
Mistral AI Integration
Add governance to Mistral AI API calls. Control Zero intercepts requests through the Governance Gateway and enforces your dashboard policies on every interaction.
Overview
Mistral AI provides high-performance language models via an OpenAI-compatible API. When routed through the Control Zero Governance Gateway, every request is governed by your policies and logged for audit.
Mistral uses the OpenAI-compatible wire format, so the integration reuses the same interceptors and policy enforcement as the OpenAI integration.
Setup
1. Configure the Gateway
Enable the Mistral provider in your Governance Gateway configuration:
# Environment variables for the gateway
CZ_GATEWAY_MISTRAL_ENABLED=true
CZ_GATEWAY_MISTRAL_API_KEY=your_mistral_api_key
2. Route Requests Through the Gateway
Point your client at the gateway's Mistral endpoint:
import openai
# Route through Control Zero gateway instead of direct Mistral
client = openai.OpenAI(
base_url="http://localhost:8000/mistral/v1",
api_key="cz_live_your_key_here",
)
response = client.chat.completions.create(
model="mistral-large-latest",
messages=[{"role": "user", "content": "Explain the difference between L1 and L2 regularization."}],
)
print(response.choices[0].message.content)
3. Define Policies
Create policies in the dashboard to govern Mistral usage:
{
"name": "mistral-usage-policy",
"rules": [
{
"effect": "allow",
"action": "llm:chat.completions",
"resource": "mistral/*",
"conditions": { "model": ["mistral-large-latest", "mistral-medium-latest"] }
},
{
"effect": "deny",
"action": "llm:chat.completions",
"resource": "mistral/*",
"conditions": { "max_tokens_gt": 8192 }
}
]
}
What Gets Governed
| API Endpoint | Policy Action | Description |
|---|---|---|
POST /mistral/v1/chat/completions | llm:chat.completions | Chat completions (streaming and non-streaming) |
POST /mistral/v1/completions | llm:completions | Text completions |
GET /mistral/v1/models | llm:models.list | Model listing |