Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Track Your Lifts with a Local AI Workout Log

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to set up a local AI workout log that tracks your lifts, calculates progress, and gives you feedback—all without sending your data to the cloud. You'll enter your sets, reps, and weights into a plain-text file or spreadsheet, and a local AI script (like one running on Ollama or a Python script) will parse, analyze, and display trends. By the end, you'll have a private, customizable system that works offline.

What You'll Need

  • A computer (Windows, macOS, or Linux) with at least 8GB RAM (16GB recommended for larger models).
  • Basic comfort with the command line (Terminal on Mac/Linux, Command Prompt or PowerShell on Windows).
  • Python 3.8+ installed (check with python --version).
  • Ollama installed (from ollama.com) for local AI models, or a Python environment with pandas and matplotlib if you prefer a non-AI script.
  • A code editor (VS Code, Notepad++, or even plain Notepad) for editing files.

Step-by-Step

  1. Choose your log format. Decide how you'll record your lifts. The simplest is a CSV file (e.g., workout_log.csv) with columns: date, exercise, weight_kg, reps, sets. Alternatively, use a Markdown file with lines like 2025-03-01: Squat 100kg x 5 x 3. The AI will parse this later.
  2. Create the log file. Open your editor, create a new file named workout_log.csv, and add a header row. Example: date,exercise,weight_kg,reps,sets. Save it in a dedicated folder, e.g., ~/gym_log/.
  3. Install Ollama and pull a model. Open your terminal and run ollama pull llama3.2 (or a smaller model like phi3 if you have limited RAM). This downloads the model locally—no internet needed after this step.
  4. Write the AI script. Create a Python file (e.g., log_ai.py) that:
    1. Reads the CSV file using Python's csv module.
    2. Stores each lift as a dictionary with keys for date, exercise, weight, reps, sets.
    3. Sends a prompt to Ollama via its API (using requests or urllib) asking for a summary of progress, e.g., "Based on this log, which lifts improved most? Suggest next week's weights."
    4. Prints the AI's response to the terminal.
  5. Test the script. Add a few sample entries to your CSV (e.g., three squat sessions with increasing weights). Run python log_ai.py. If it outputs a sensible analysis, your setup works.
  6. Automate data entry (optional). To make logging faster, create a second script add_entry.py that takes command-line arguments: python add_entry.py --exercise squat --weight 100 --reps 5 --sets 3. This appends a row to your CSV with today's date.
  7. Analyze trends with a non-AI script (optional). If you don't want AI, write a simple Python script using pandas to calculate estimated 1RM (Epley formula: weight * (1 + reps/30)) and plot progress with matplotlib. This gives you numeric trends without any AI.
  8. Set up a daily prompt. Create a shell script (e.g., daily_log.sh) that opens your CSV in a text editor for manual entry, then runs the AI script. Schedule it with cron (Mac/Linux) or Task Scheduler (Windows) to remind you to log.

Common Mistakes

  • Inconsistent units. Mixing kilograms and pounds in the same column breaks calculations. Stick to one unit, or add a separate unit column.
  • Typos in exercise names. "Squat" vs "squat" vs "Squats" will be treated as different exercises by the AI. Use a consistent naming convention (lowercase, no plurals).
  • Forgetting to save the CSV. If you edit in an editor and don't save before running the script, the AI reads stale data.
  • Overloading the AI with huge logs. Sending years of data in one prompt may exceed the model's context window. Summarize or limit to recent sessions.
  • Not backing up. Local files can be lost. Use a version control system like Git to track changes, or copy the folder to an external drive.

Tips

  • Use a template. Start with a simple CSV template and expand columns as needed (e.g., add RPE or notes).
  • Let the AI give feedback. Ask it to compare your last session to the previous one and suggest a weight increase (e.g., +2.5kg) based on rep performance.
  • Keep a separate file for notes. Use a notes.md for subjective feelings (sleep, soreness) and reference it in prompts.
  • Use short, specific prompts. Instead of "analyze my log," ask "What is my estimated 1RM for bench press from the last 4 weeks?"
  • Test with a small model first. If you have limited RAM, use phi3 (3.8B) instead of llama3.2 (8B) to avoid slowdowns.

Troubleshooting

  • Ollama not responding. Ensure the Ollama service is running (run ollama serve in a separate terminal). Check that the model is pulled (ollama list).
  • Script errors with 'ModuleNotFoundError'. Install required Python packages: pip install requests pandas matplotlib.
  • AI output is gibberish. Your prompt may be too vague or the model too small. Try simplifying the prompt and ensuring the CSV data is clean (no missing commas).
  • File not found. Make sure the script's working directory matches the folder containing your CSV. Use absolute paths in the script (e.g., /home/you/gym_log/workout_log.csv).
  • CSV parsing errors. If you have commas inside notes, enclose fields in quotes (e.g., "felt tired, but ok").

Frequently Asked Questions

Q: Do I need an internet connection after initial setup?
A: No. Once the AI model is downloaded and Python packages are installed, everything runs offline.

Q: Can I use this with a spreadsheet like Excel?
A: Yes. Save your Excel sheet as a CSV file and point the script to it. Just ensure the columns match.

Q: What if I don't want to use AI at all?
A: The same log file can be analyzed with a simple Python script that calculates volume, estimated 1RM, and trends without any AI.

Q: How do I handle deload weeks or missed sessions?
A: Log them as usual with a note (e.g., deload in the notes column). The AI can be prompted to ignore those for progress calculations.

Q: Is my data private?
A: Yes, because everything stays on your machine. No cloud services are involved.

Q: Can I track bodyweight exercises (push-ups, pull-ups)?
A: Yes. Use weight as 0 and reps/sets. For weighted pull-ups, enter the added weight.