Configure a provider
malac talks to models through providers. A provider is an endpoint plus a wire format: openai (chat completions) or anthropic (the Messages API). Anything that speaks one of the two works, including gateways and local servers. You can configure several providers at once and switch between their models at any time.
Built-in providers
Section titled “Built-in providers”Two providers are always defined:
| Provider | Kind | Base URL | Key variable |
|---|---|---|---|
anthropic |
anthropic |
https://api.anthropic.com |
ANTHROPIC_API_KEY |
openai |
openai |
https://api.openai.com/v1 |
OPENAI_API_KEY |
If no model is configured, malac picks anthropic/claude-sonnet-5-5 when ANTHROPIC_API_KEY is set, otherwise openai/gpt-5 when OPENAI_API_KEY is set. With neither, it asks you to add a provider.
Add a provider
Section titled “Add a provider”malac provider add writes a [providers.<name>] table to ~/.malac/config.toml, replacing any provider with the same name:
printf '%s' "$LORA_API_KEY" | malac provider add lora \ --base-url https://lora.example.com/v1 --model default --api-key-stdin --set-defaultThis adds a provider called lora for an OpenAI-compatible gateway at lora.example.com, stores its key, and makes lora/default the default model.
| Flag | Meaning |
|---|---|
<name> |
Provider name, used in model specs such as lora/smart |
--base-url <url> |
Endpoint. Required. |
--kind openai|anthropic |
Wire format. Default openai. |
--model <id> |
Model to list for this provider and to use with --set-default |
--api-key-env <VAR> |
Read the key from this environment variable |
--api-key-stdin |
Read the key from stdin and store it in ~/.malac/credentials.toml (mode 0600) |
--set-default |
Make <name>/<model> the default model. Needs --model. |
To keep the key in your environment instead of on disk:
malac provider add anthropic-work --kind anthropic \ --base-url https://api.anthropic.com --api-key-env WORK_ANTHROPIC_KEY \ --model claude-sonnet-5-5When malac needs a key, it looks in the provider’s api_key_env variable first, then in ~/.malac/credentials.toml.
Check providers and models
Section titled “Check providers and models”malac provider list # providers, base URLs and whether a key is setmalac provider models lora # models one provider servesmalac models # every model of every provider; * marks the defaultThe same thing in TOML
Section titled “The same thing in TOML”model = "lora/default" # default model, as provider/modelsmall_model = "lora/fast" # used for compaction summariesvision_model = "lora/vision" # describes images for models without vision
[providers.lora]kind = "openai"base_url = "https://lora.example.com/v1"api_key_env = "LORA_API_KEY"models = ["default", "smart", "fast", "vision"]
[providers.local]kind = "openai"base_url = "http://localhost:11434/v1"models lists the ids offered by /model, the model picker and the web UI. headers adds extra HTTP headers to every request:
[providers.lora]headers = { "X-Team" = "platform" }Model specs
Section titled “Model specs”A model is written provider/model, for example lora/smart. A bare name such as smart uses the provider of the default model. If the part before the first / is not a provider name, the whole string is a model id on the default provider, so deepseek/v4 with a default of lora/default means model deepseek/v4 on lora.
Pick a model per run with -m, or switch inside a session with /model:
malac -m lora/smart review the auth modulePer-model settings
Section titled “Per-model settings”[models."lora/default"]context_window = 200000 # compaction starts at 80% of thismax_output_tokens = 16384 # max_tokens sent with each requestvision = false # route images through vision_modeltemperature = 0.2
[models."anthropic/claude-sonnet-5-5"]thinking_budget = 8000 # Anthropic extended thinkingAll keys are optional; see Configuration for the defaults.
Profiles
Section titled “Profiles”A profile is a named overlay applied with --profile:
[profiles.fast]model = "lora/fast"
[profiles.yolo]mode = "autopilot"malac --profile fast summarize the open TODOs- Using an LLM gateway: one key, many models, both wire formats.
- Running models locally: Ollama and vLLM.
malac is created by lobirus and released under the MIT license. About malac