Skip to content

Modernize agent (uv + LiveKit Inference) and update all dependencies#39

Merged
bcherry merged 3 commits into
mainfrom
migrate-uv-livekit-inference
Jun 5, 2026
Merged

Modernize agent (uv + LiveKit Inference) and update all dependencies#39
bcherry merged 3 commits into
mainfrom
migrate-uv-livekit-inference

Conversation

@bcherry

@bcherry bcherry commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Modernizes the project's tooling and brings every dependency up to the latest version across both the agent and the web frontend. Also includes a livekit.toml for deployment to livekit cloud.

Agent

Tooling → uv

  • Replace requirements.txt and ruff.toml with a uv-managed pyproject.toml + committed uv.lock.
  • Fold the old ruff config into [tool.ruff].

Model → LiveKit Inference

  • Switch the vision (guessing) and judging LLM calls from the OpenAI SDK directly to LiveKit Inference (openai/gpt-4o-mini).
  • Inference authenticates with the existing LIVEKIT_API_KEY / LIVEKIT_API_SECRET, so OPENAI_API_KEY is no longer required.
  • Guesses/judgements now build a ChatContext with ImageContent and stream through a small _llm_complete() helper; JSON output uses response_format via extra_kwargs.

Deployment

  • Deploy agent to LiveKit Cloud instead of fly.io
  • Rewrite the Dockerfile as a multi-stage uv build (build toolchain stays out of the runtime image; runs as non-root appuser; ~456MB). Stop git-ignoring it so it's tracked.
  • Update the README to use uv and drop the OpenAI key requirement.

Dependencies

  • Latest LiveKit Agents SDK (livekit-agents 1.5.17), openai 2.41, and refreshed transitive deps.

Web frontend

Every dependency updated to latest, including major versions:

Package From To
next 14.2 16.2
react / react-dom 18.3 19.2
tailwindcss 3.4 4.3
typescript 5.8 6.0
eslint 8.57 9.39
eslint-config-next 14.2 16.2
@livekit/components-react 2.9.2 2.9.21
livekit-client 2.11 2.19
livekit-server-sdk 2.12 2.15
@types/react, @types/node, … 18 / 20 19 / 25

Migration work required by the major bumps:

  • Next 16 / React 19 — move viewport/themeColor out of metadata into a dedicated viewport export; pin the Turbopack workspace root in next.config.mjs (avoids inferring an unrelated parent-dir lockfile). tsconfig.json updated by Next (jsxreact-jsx). No forwardRef/legacy-render changes needed.
  • Tailwind v4 — delete tailwind.config.ts (v4 auto-detects sources), switch PostCSS to @tailwindcss/postcss, and use v4 layer imports in globals.css. Deliberately preserved the "no preflight" setup so Tailwind's reset doesn't clobber the 98.css retro styling (verified the built CSS contains the utilities but none of Tailwind's universal reset).
  • ESLint 9 flat confignext lint was removed in Next 16, so .eslintrc was converted to eslint.config.mjs and the lint scripts now call the ESLint CLI. Pinned ESLint to 9 because eslint-config-next 16's bundled plugins require eslint <= 9 (10 would break linting). Added a .prettierignore so build output isn't format-checked.

Note on a lint rule

The React 19-era react-hooks plugin adds a set-state-in-effect rule that flags 5 intentional, SSR-safe patterns in the providers (initializing state from localStorage / window.location.hash in mount effects). Rewriting those is a behavior-risky refactor that's out of scope for a dependency bump, so the rule is set to warn (with an explanatory comment) rather than failing lint.

Testing

  • Agent: uv sync, uv lock --locked, ruff check pass; modules import against the new SDK; Docker image builds and the runtime image smoke-tests clean. Live-tested LiveKit Inference end-to-end (vision guess + JSON winners).
  • Web: pnpm build (TypeScript 6), pnpm lint (0 errors), and pnpm format:check all pass.
  • End-to-end: booted the agent + frontend together; agent registers as a worker, the frontend SSRs the full app shell with Tailwind utilities and 98.css applied, and the token API returns 200. A full game round was played to confirm guessing and winner detection work.

Modernize the agent's tooling and model integration:

- Replace requirements.txt and ruff.toml with a uv-managed
  pyproject.toml + uv.lock, on the latest LiveKit Agents SDK (~=1.5)
  and bumped dependencies.
- Switch the vision/judging LLM calls from the OpenAI SDK directly to
  LiveKit Inference (openai/gpt-4o-mini). Inference authenticates with
  the existing LIVEKIT_API_KEY/SECRET, so no separate OPENAI_API_KEY is
  required.
- Rewrite the Dockerfile as a multi-stage uv build and stop ignoring it
  in git; remove the fly.toml deployment file.
- Update README setup instructions to use uv and drop the OpenAI key.
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
livepaint Ready Ready Preview, Comment Jun 4, 2026 9:14pm

Request Review

Agent (uv):
- Bump livekit-agents 1.5.16 -> 1.5.17, openai 2.40 -> 2.41, and minor
  transitive deps via `uv lock --upgrade`.

Web (pnpm) - upgrade everything to latest, including major versions:
- next 14 -> 16, react/react-dom 18 -> 19, tailwindcss 3 -> 4,
  typescript 5 -> 6, eslint 8 -> 9, eslint-config-next 14 -> 16, plus
  LiveKit SDKs and type packages.

Migration work for the major bumps:
- Next 16 / React 19: move viewport/themeColor into a `viewport` export;
  pin Turbopack workspace root in next.config.mjs.
- Tailwind v4: drop tailwind.config.ts (sources are auto-detected), switch
  to @tailwindcss/postcss, and use v4 layer imports in globals.css. Keep
  the "no preflight" setup so 98.css styling isn't reset.
- ESLint 9 flat config: replace .eslintrc with eslint.config.mjs and point
  the lint scripts at the eslint CLI (next lint was removed in Next 16).
  Pin eslint to 9 since eslint-config-next 16's plugins require <=9.
- Add a .prettierignore so build output isn't format-checked.

The new react-hooks `set-state-in-effect` rule is set to a warning: the
providers intentionally initialize state from browser APIs in mount
effects for SSR safety.

Verified: pnpm build (TS 6), lint, and format:check pass; agent registers;
frontend renders and the token API works.
@bcherry bcherry changed the title Migrate agent to uv + LiveKit Inference Modernize agent (uv + LiveKit Inference) and update all dependencies Jun 4, 2026
@bcherry bcherry requested review from Copilot and rektdeckard June 4, 2026 21:11
@bcherry bcherry review requested due to automatic review settings June 4, 2026 21:12
@bcherry bcherry merged commit 0f4482b into main Jun 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant