Skip to content

Installation and launch

Use Python 3.13 and uv. Published packages include the built browser client:

uv tool install phrase-gym --upgrade --python 3.13

Until a release is published, install from a source checkout with Node 22.12+ on an LTS release:

uv sync --frozen
npm --prefix frontend ci
npm --prefix frontend run build

Start the server; Piper is not required to launch it:

phrase-gym run

For a source checkout, use uv run phrase-gym run instead. Open http://127.0.0.1:8000. Use phrase-gym run --help for the port and data-directory options. Keep learner recordings outside the source checkout. Actual microphone and headset acceptance requires attended testing on the learner's MacBook.

Preparation with Coach

Coach is the application's separate preparation process for text typed into the Coach field. It needs two things on the same Mac:

  • At least one logged-in preparation CLI: the Codex CLI with your ChatGPT subscription (codex login), the Claude Code CLI with your Claude subscription (run claude and log in), or the free tier of the Antigravity CLI (agy, logged in once with a Google account). Coach uses your normal login and never an API key or paid API access.
  • Internet access the first time it speaks a language: Coach installs its local Piper voices for the reference audio by itself, as described in Coach’s voices.

Coach is its own command, phrase-gym-coach, from the same package. Install the package with the coach extra, which carries anything Coach needs beyond the server:

uv tool install 'phrase-gym[coach]' --upgrade --python 3.13

pipx install --python python3.13 'phrase-gym[coach]' works the same way. Run Coach in another terminal while the server is running:

phrase-gym-coach

For a source checkout, use uv run phrase-gym-coach. --url points Coach at a server on another local port, for example phrase-gym-coach --url http://127.0.0.1:8001, and --once prepares at most one waiting text and exits. Coach receives typed text through Phrase Gym's API, prepares a card, generates its reference audio and publishes it. A card usually takes a few minutes. The first card also installs Piper and the first card in each language downloads that language's voice; Coach prints a line while it does so. Imports from an external AI agent arrive with complete audio and do not need Coach.

Coach provider

Choose which access Coach uses under Settings → Coach provider:

  • Autodetect, the default, tries your Codex subscription, then your Claude subscription, then Gemini free.
  • Codex subscription or Claude subscription uses that subscription and falls back to Gemini free while it is unavailable, for example after its usage limit. Your choice stays saved; Coach returns to your subscription once it is available again, at most about ten minutes after a failure.
  • Gemini free uses only the free tier.

Before a subscription's first card, Coach reads the CLI's login status (codex login status or claude auth status); when that is unclear, it sends one short "Reply OK" request on the preparation model. Coach remembers the answer for about ten minutes. After a subscription's call fails, for example on its usage limit or a timeout, Coach treats that subscription as unavailable for the same ten minutes; logging in again or changing the CLI's settings ends the wait early. A route that fails partway, for example on its quota or a timeout, leaves no card: Coach prepares the text again from the start on the next route. A rejected text, for example one in another language, is not tried again elsewhere. When every route fails, the Coach page shows one service failure with Retry. Coach prints a line for every preparation that fails, and for every card made after a switch, with the file that records each route it tried, its model and the reason it moved on.

phrase-gym-coach --cli codex, --cli claude or --cli gemini overrides the setting for that Coach process: a subscription still falls back to Gemini free, and --cli gemini uses only the free tier.

Both subscriptions use the same card rules in separate preparation and review calls: Codex runs GPT-6.1 Sol and Claude runs Claude Opus 5.5, both at medium effort, whatever model you use elsewhere. Each call uses your normal subscription login and runs in its own empty temporary folder. Cards need no tools, so Coach keeps each call small: Claude may only read the call's own task file and loads no MCP servers or project settings, and Codex skips project instructions, plugins, apps and other tools the card does not need. Coach keeps each attempt's prompts, answers and logs in an attempts folder inside its per-user cache folder, which also holds its voices, or inside the folder named by PHRASE_GYM_COACH_WORKSPACE when that is set. A successful attempt's folder is removed.

On Gemini free, Coach runs Gemini 3.8 Flash at low effort and only checks your text: it confirms the word or phrase and fixes an obvious typo. You then get a basic card that asks you to fill the gap in your own sentence, even where the sentence changes the phrase's form (She came up with a plan for come up with), or to recall the words from a partial form that shows their first letters, the last letter of longer words and one _ per hidden letter, such as def_____ly or o_ t__ f___e; a partial-form card asks you to say the whole word or phrase. It has no explanation or extra examples, and a German noun stays as you typed it, without an added article. The card's instruction and Coach's reasons use your native language from Settings; a corrected typo appears only in the Coach page, never on the card. Coach runs agy the way news-recap does: one launch at a time, at least ten seconds apart, with its permission prompts skipped, so the model's tools are not limited to its temporary folder. If Antigravity renames the model, Coach switches to the cheapest listed Flash model for the rest of its run. Free-tier usage is subject to a quota.

The planned phrase-gym-coach install and phrase-gym-coach uninstall background-service commands and phrase-gym deploy report that they are unavailable. The server never loads Coach: phrase-gym run and its help need only the lean installation. Today Coach needs no libraries beyond the server's, so the coach extra adds nothing yet; the deploy extra is reserved for future provisioning.

For access from another device, see private Tailscale access. Keep a private backup of your learning data.