Tidal 2025
Here’s the bare-minimum stuff they need plus copy-paste setup commands for macOS, Linux, and Windows.
- Python 3.10+ (3.11/3.12 fine)
- Ollama installed locally (for kid-friendly rewrites)
- Llama 3 instruct model (or any local model you choose)
flasksympyrequestsorjson(fast JSON; if it fails on your platform, useujsonor Python’s built-injsonand remove the orjson import/write path.)
Optional (nice to have):
waitress(to serve on Windows without Flask’s dev server)
flask>=3.0
sympy>=1.12
requests>=2.31
orjson>=3.10
After installing Ollama:
# pull a small-ish instruct model (as used in your code)
ollama pull llama3:instructIf you want to swap models, change OLLAMA_MODEL env var (see below).
# From the folder with your .py file:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
# Make sure Ollama is running (app or daemon), then:
ollama list # sanity check; should show llama3:instruct
# (Optional) tweak env:
export OLLAMA_MODEL="llama3:instruct" # default already
export OLLAMA_URL="http://127.0.0.1:11434" # default already
export OLLAMA_TIMEOUT_S=60
export AIMATH_HISTORY="$HOME/.aimathcoach/history.jsonl"
# Run the app:
python your_file_name.py
# Open http://127.0.0.1:5000 in your browser# From the folder with your .py file:
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt
# Ensure Ollama is running (Windows app/service), then:
ollama list
# (Optional) env vars for this session:
$env:OLLAMA_MODEL = "llama3:instruct"
$env:OLLAMA_URL = "http://127.0.0.1:11434"
$env:OLLAMA_TIMEOUT_S = "60"
$env:AIMATH_HISTORY = "$env:USERPROFILE\.aimathcoach\history.jsonl"
# Run the app:
py your_file_name.py
# Open http://127.0.0.1:5000If you prefer a production server on Windows:
pip install waitress
waitress-serve --listen=127.0.0.1:5000 your_file_name:appOLLAMA_URL(default:http://127.0.0.1:11434)OLLAMA_MODEL(default:llama3:instruct)OLLAMA_TIMEOUT_S(default:60.0)OLLAMA_TEMPERATURE(default:0.3)OLLAMA_NUM_PREDICT(default:700)AIMATH_HISTORY(default:~/.aimathcoach/history.jsonl)READING_LEVEL(default:Grade 6)
Example .env-style snippet (bash):
export OLLAMA_MODEL="llama3:instruct"
export OLLAMA_TIMEOUT_S="60"
export READING_LEVEL="Grade 6"-
“AI unavailable / model not installed” banner → Run
ollama pull llama3:instructand ensure the Ollama service is running. -
orjsoninstall issues on unusual platforms → Replaceimport orjsonwithimport json as orjsonand adjustwrite_historyto useorjson.dumps(...).encode()or justjson.dumps(...). -
Firewall/port → The app serves on
127.0.0.1:5000. If you change the host to0.0.0.0, your OS firewall may prompt you. -
Model too slow / timeouts → Lower
OLLAMA_NUM_PREDICT, increaseOLLAMA_TIMEOUT_S, or try a smaller model. The UI has a Retry button and shows verified steps even if AI times out.
That’s it—ship the file with requirements.txt, and these commands are all your teammate/judges need to bring it up on their machine.