Configuration

# Providers & models

locallingo translates through RubyLLM, so any provider it supports works — chosen by config.

## Provider-agnostic via RubyLLM

Every translation and quality-review call goes through [RubyLLM](https://github.com/crmne/ruby_llm), so locallingo isn't tied to one vendor. You pick the provider and models in `.locallingo.yml`; the rest of the toolchain is identical regardless of which you choose.

## Choosing a provider

Set `provider` to a RubyLLM provider symbol, and the per-task models under `translate` and `quality`.

```ruby
defaults:
  provider: openai            # or anthropic, gemini, ...
  translate:
    model: gpt-5-mini
  quality:
    model: gpt-4o-mini
```

```ruby
defaults:
  provider: anthropic
  translate:
    model: claude-haiku-4-5
  quality:
    model: claude-sonnet-4-6
```

## Credentials

Credentials come from the environment, per RubyLLM's own configuration — `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, and so on. locallingo fails fast with a clear message when the configured provider's key is missing, before making any network call.

> **Note:** Only `translate` and the optional `quality --ai` pass call the provider. Everything else runs offline.

## Two models, two jobs

- `translate.model` does the bulk translation work — favour a fast, inexpensive model, since it runs over every missing/changed key in batches (`translate.batch_size`, default 20).
- `quality.model` powers the optional AI review of existing translations — a stronger model pays off here because it runs on a sample, not the whole corpus.