openGym v. 1.3

A while ago I posted openGym here a self-hosted gym and body-weight tracker built with React + Node. It runs in two Docker containers, supports passkeys, has an Android APK, 14 languages and is AGPL licensed.

The most common request I got since then was basically: "can you add some kind of coaching?"

So v1.3 now has a Coach.

I wanted to keep it in line with the rest of openGym though, so instead of sending all your workout data to some random cloud service, the Coach is designed to work with your own AI provider.

What the Coach actually does

  • You answer a few questions about your goal, experience, how often you train, session length, equipment, injuries/limitations, etc. It then creates a week of routines and explains why each exercise is there. Nothing gets changed until you approve it.
  • It can look at your actual logged workouts, stalls, RIR/RPE and body-weight trend and suggest changes. For example, swapping an exercise, removing a set or moving a training day. The suggestions include the data they're based on.
  • If nothing needs changing, it'll just tell you that. It isn't supposed to make changes for the sake of making changes.
  • You can also get a debrief after a workout with a score, what went well, what to watch out for and what to do next time.
  • And it's just a chat, so you can say things like "swap the squats, Mondays are short" instead of going through a bunch of settings.

Everything is undoable, and the Coach doesn't touch your working weights. The normal deterministic progression system still handles that.

Bring your own AI

When setting it up, the admin goes through a 5-step setup:

provider -> endpoint -> key -> model -> test

You can use:

  • Anthropic
  • OpenAI
  • Gemini
  • Any OpenAI-compatible endpoint (Ollama, LM Studio, vLLM, OpenRouter, your own gateway, etc.)
  • A local model if you want. The prompts are designed so models like llama.cpp can make use of prefix caching after the first request.
  • There's also an opt-in image target for running Claude Code / Codex inside the container.

The phone app can either use the server's provider or its own API key.

Privacy

This was probably the part I spent the most time on.

The Coach doesn't just dump your whole database into an LLM.

It sends an allowlisted set of data: your plan, relevant sessions, aggregates, body weight and your answers to the intake questions. It's sent using an opaque handle, so your name, login and other users' data aren't included.

Each user has to consent individually and can see what categories of data will be sent before using the Coach.

API keys are encrypted on the server and only sent to the provider while a job is running. The admin can see usage counts and outcomes, but not what users asked the Coach.

There's a more detailed write-up in docs/AI_COACH.md.

Also added in 1.3:

  • Per-exercise bar weight / plates-per-side with one tap
  • Rest-day indicator on the home screen
  • A rewritten admin dashboard that's hopefully a bit easier to understand

Links

Source + releases: https://gitlab.com/DuarteSantos8/opengym

Website / docs / APK: https://opengym.duarte-santos.ch

Try it directly in the browser: https://opengym.duarte-santos.ch/demo/

The demo Coach uses a canned response, so you don't need an API key to try the UI. The actual Coach needs a provider configured.

For existing self-hosters:

docker compose pull && docker compose up -d

Then go to Settings -> Admin -> AI Coach.

I'm especially interested in feedback on the prompt design and the validator. The model's response gets checked against a closed list of allowed change types and real exercise IDs before anything can actually be applied.

Also happy to answer questions about running it with Ollama / local models.

It's free and will stay free. AGPL, no pro tier.

If openGym ends up replacing a paid tracker for you, there's a Buy Me a Coffee link on the website. That mostly goes towards hosting, signing certificates and properly licensing the exercise content.

submitted by /u/0_KermitTheFrog_0
[link] [留言]