Getting started

Installation

Add the gem, create a config file, and point it at your LLM provider.

Add the gem#

In your app's Gemfile.

locallingo is a development-time tool — it never runs in production — so put it in the :development group. It pulls in RubyLLM as its provider client.

Gemfile
group :development do
  gem "locallingo"
end

Then bundle install.

Generate the binstub#

The gem installs an executable called lingo. Generate a binstub so you can run it via bin/lingo inside your app's bundle:

shell
bundle binstubs locallingo

Provider credentials#

locallingo never stores API keys. The simplest setup is an environment variable named for your provider — for example OPENAI_API_KEY for OpenAI or ANTHROPIC_API_KEY for Anthropic.

.env
OPENAI_API_KEY=sk-...

If your key lives somewhere other than ENV, configure the gem from Ruby in a .locallingo.rb file at your app root — the CLI loads it on start, no Rails boot required. See Providers & models for the full credential resolution order.

.locallingo.rb
Locallingo.configure do |config|
  config.anthropic_api_key = -> { AppConf.anthropic_api_key }
end
Only translation and the optional AI quality pass need credentials. `status`, `validate`, `sync`, and the static quality checks run with no key at all.

Create the config file#

Add a .locallingo.yml at your app root. The smallest useful config names your source and target locales; every other key has a sensible default (see the Configuration reference).

.locallingo.yml
defaults:
  source_locale: en
  target_locales: [de, sv]

  provider: openai
  translate:
    model: gpt-5-mini
  quality:
    model: gpt-4o-mini

  context: "Acme, a business application"
  glossary:
    entity: "business/company account holder"

That's it — head to the Quick start.