Skip to content

Providers

refact-planner edited this page Jun 7, 2026 · 1 revision

Providers

Provider families, OAuth-backed providers, and where their YAML defaults live in the engine.

Refact loads provider templates from refact-agent/engine/src/yaml_configs/default_providers/ and combines them with any user overrides from ~/.config/refact/providers.d/.

Provider families

The engine includes these provider families in src/providers/ and the default provider templates:

  • Anthropic
  • Claude Code
  • OpenAI
  • OpenAI Responses
  • OpenAI Codex
  • OpenRouter
  • Groq
  • DeepSeek
  • Doubao
  • xAI
  • xAI Responses
  • Google Gemini
  • Qwen
  • Kimi
  • Zhipu
  • MiniMax
  • GitHub Copilot
  • Ollama
  • LM Studio
  • vLLM
  • custom OpenAI-compatible providers

The default template list is assembled in src/caps/providers.rs from the YAML files in yaml_configs/default_providers/.

ProviderDefaults

Each provider contributes ProviderDefaults for three model roles:

  • chat
  • completion
  • embedding

Those defaults are used when the provider exposes or derives model records for a given role. The structure is defined in refact-core/src/provider_types.rs and re-exported through refact-agent/engine/crates/refact-providers/src/config.rs.

OAuth providers

Two provider families are OAuth-backed:

  • Claude Code — uses per-provider OAuth tokens and subscription login flow.
  • OpenAI Codex — uses OAuth-backed ChatGPT/Codex account access.

Both keep their login state in the provider instance config and refresh tokens when needed.

YAML config location

Default provider templates live in:

refact-agent/engine/src/yaml_configs/default_providers/

User-configured provider overrides are read from:

~/.config/refact/providers.d/

The engine reads those YAML files, merges them with the matching built-in template when one exists, and exposes the resulting providers through the capabilities API.

Adding a provider

For a new provider, create a YAML template, add it to the template list, and make sure the provider exposes the right chat/completion/embedding defaults and model metadata. See CONTRIBUTING for the code path and examples.

Related pages

Clone this wiki locally