/lattifai-skills:lai-setupfrom lattifai-skills
Installs LattifAI and obtains a free trial API key for word-level caption-to-audio alignment. Useful for first-time setup and authentication.
Ships in lattifai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
LattifAI aligns captions to audio at word-level precision. Two steps to get started.
Requires Python 3.10+. Choose either installer:
uv (≈10–15× faster)# One-time: install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh # or: brew install uv / pip install uv
# Install lattifai
uv pip install lattifai --extra-index-url https://lattifai.github.io/pypi/simple/
# Workaround for a known entry-point name conflict — re-install lattifai
# last so its `lai` console script wins. Without this, `lai --version`
# may fail with "No such option: --version" (an upstream `lattifai-run`
# package also claims the `lai` script name).
uv pip install --reinstall-package lattifai lattifai \
--extra-index-url https://lattifai.github.io/pypi/simple/
Typical end-to-end runtime on broadband: ~1 minute. uv parallelizes downloads and resolves the dependency graph in Rust; it also dedupes wheels across envs via a global cache, so subsequent installs in fresh envs are near-instant.
pippip install lattifai --extra-index-url https://lattifai.github.io/pypi/simple/
First pip install takes 5–15 minutes on broadband — torch (~80 MB), onnxruntime, scipy, transformers are all sizeable wheels. pip's serialized download + sequential install order happens to land on the right lai script automatically, so no workaround needed.
You may see a cosmetic WARNING: No metadata found ... Can't uninstall 'setuptools' line during install — known anaconda + pip interop quirk, safe to ignore.
lai auth trialFor new users this is the only command you need. It claims a no-sign-up trial (2 hours of alignment credits, valid 14 days). There is no
lai logincommand — it'slai auth trial(new user) orlai auth login(existing paid account).
lai auth trial
The output shows your credits and expiry. You're ready.
API key is user-level, not env-level. The credentials live in
~/.lattifai/config.tomland are shared across every Python / conda env on the same machine. Switching to a fresh env does not require re-authenticating; runninglai auth trialin a new env on a machine that already has an active trial returns "You already have an active trial (expires …)". To rotate, runlai auth logoutfirst.
To double-check the environment any time: lai doctor (FAIL rows include a fix suggestion).
On lai doctor warnings:
lai alignment / lai youtube align run. The warning lifts itself once the prefetch completes.lai update to grab the latest CLI. Recommended monthly, or whenever a feature you need is in a newer release.| Problem | Fix |
|---|---|
pip can't find lattifai or its dependency lattifai-core | Re-run with --extra-index-url https://lattifai.github.io/pypi/simple/ (lattifai-core ships only on the LattifAI mirror) |
lai --version returns No such option: --version after uv pip install | Entry-point name conflict — lattifai-run also claims the lai script. Run uv pip install --reinstall-package lattifai lattifai --extra-index-url https://lattifai.github.io/pypi/simple/ to re-install lattifai last. |
lai auth trial returns 429 | Trial already used on this device — run lai auth login for a full account |
| API key invalid / expired (trial expires after 14 days) | lai auth logout, then lai auth trial (new device) or lai auth login (paid account) |
Couldn't load entrypoint <name>: No module named 'lattifai' on lai startup | Stale editable install — pip show lattifai reveals Editable project location: /path/that/no-longer-exists. Run pip uninstall -y lattifai lattifai-core lattifai-run k2py then reinstall non-editable per Step 1 |
lai command runs but outputs EXPIRES_AT warning past today | Trial key expired — re-run lai auth trial (new key) |
| Outdated package | lai update |
Once authenticated, jump straight to the feature you need:
/lai-align — align audio + existing captions/lai-transcribe — transcribe audio/video from scratch (also covers Gemini API key setup)/lai-youtube — process a YouTube video end-to-endWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
lattifai, setup, installation, authentication, trial-key, audio-alignment
9 skills in this plugin
/lai-alignAlign existing captions to audio/video with word-level precision using the Lattice-1 model. Trigger when the user has both a media file AND a caption/transcript that need to be synchronized, or says "fix caption timing", "字幕对不上", "对齐字幕", "word-level timestamps", "karaoke timing", "timestamps are off". Do NOT trigger without existing text — use `/lai-transcribe` first./lai-captionConvert between 30+ caption/subtitle formats (SRT, VTT, ASS, JSON, TextGrid, LRC, FCPXML, Premiere, …) and shift timing. Trigger on "convert captions", "SRT to VTT", "转换字幕格式", "shift timing", "ASS styling", "karaoke effect", "导入Premiere", or any caption-format question. Do NOT trigger to fix timing accuracy (`/lai-align`) or translate (`/lai-translate`)./lai-npx claudepluginhub lattifai/lattifai-skills --plugin lattifai-skillsOther plugins' skills for the same job