A visual tour of PFun CMA Model’s interactive demos, desktop application, and output visualizations.
Generate physiologically valid scenarios from natural language. The LLM translates qualitative descriptions into CMA model parameters with clinically relevant recommendations.


Control model parameters interactively with sliders and see live glucose curve updates via WebSocket:


→ WebSocket Streaming deep dive
Precomputed parameter grids stored in DuckDB, visualized to explore the full CMA parameter space:

Full cortisol-melatonin-adiponectin decomposition from glucose time series:

Side-by-side model fit (blue) vs. observed data (red):


Automatically generated parameter tables with qualitative descriptors:

A screencast demonstrating the real-time WebSocket data streaming interface:
When running the dev server (uv run fastapi dev pfun_cma_model/app.py --port 8001):
| Demo | URL | Description |
|---|---|---|
| LLM Scenario | /demo/llm |
Natural language → scenario generation |
| Run-at-Time | /demo/run-at-time |
WebSocket + Chart.js live plotting |
| Canvas Wave | /demo/canvas-wave |
HTML5 Canvas wave equation visualization |
| Full Model Run | /demo/full-model-run |
Complete CMA model with all signals |
| WebGL Plot | /demo/webgl-demo |
GPU-accelerated real-time plotting |
| Data Stream | /demo/data-stream |
Server-sent data streaming |