OpenAI
KhunQuant connects to OpenAI (and any OpenAI-compatible endpoint) via the openai_compat/ provider. This covers OpenAI, Azure OpenAI, LiteLLM, OpenRouter, Groq, and others that implement the OpenAI chat completions API.
Configuration
Add to ~/.khunquant/config.json:
{
"model_list": [
{
"model_name": "gpt4o",
"model": "gpt-4o",
"api_key": "OPENAI_API_KEY"
}
]
}
Add the API key to ~/.khunquant/.security.yml:
model_list:
- model_name: gpt4o
api_key: "sk-..."
Azure OpenAI
Use api_base to point to your Azure deployment:
{
"model_list": [
{
"model_name": "azure-gpt4",
"model": "gpt-4o",
"api_base": "https://your-resource.openai.azure.com/openai/deployments/your-deployment",
"api_key": "AZURE_OPENAI_KEY",
"auth_method": "azure"
}
]
}
OpenAI-compatible endpoints
Any endpoint implementing the OpenAI chat completions format works:
{
"model_list": [
{
"model_name": "groq-llama",
"model": "llama-3.1-70b-versatile",
"api_base": "https://api.groq.com/openai/v1",
"api_key": "GROQ_API_KEY"
},
{
"model_name": "openrouter",
"model": "anthropic/claude-sonnet-4-6",
"api_base": "https://openrouter.ai/api/v1",
"api_key": "OPENROUTER_API_KEY"
}
]
}