Skip to content

Ready Feature: OpenAI Evaluation of Nightscout Data #8396

@xannasavin

Description

@xannasavin

This is not a feature request — the feature is already implemented and working.

Disclaimer: Since I’m not deeply familiar with the Nightscout project’s infrastructure and coding standards, I made use of an AI coding agent for the development. I have tested the feature thoroughly and it works as expected, but I cannot guarantee the code quality or compliance with project conventions.


What the feature does

I have added a new AI Evaluation tab to the Nightscout reporting view.

  • The selected CGM report data (up to 14 days) is sent to an LLM (e.g., OpenAI GPT-4o) for evaluation.
  • Each day is analyzed individually, and the AI then produces a clear and understandable summary of the whole period.
  • Results are displayed directly in Nightscout, structured into daily interim evaluations and a final report.

Admin Settings

New settings in the Admin Tools allow users to:

  • Configure the system and user prompts for AI calls.
  • Control the model and endpoint used.
  • View a cost overview: all tokens are converted into USD, logged, and aggregated monthly.
  • See a cost preview for each current request directly in the frontend.

Key Features

  • Configurable prompts for flexibility.
  • Secure API key & Credentials handling (server-side only).
  • Token usage & cost tracking with summaries per month.
  • Debug mode to inspect prompts and AI responses.
  • Automatic JSON repair if the AI returns invalid data.

Status

  • Feature is implemented and running in a test branch.
  • Supports OpenAI-compatible endpoints with configurable models.
  • Admin integration for prompts and usage stats is included.
  • Fully tested functionally, but code quality needs review against Nightscout standards.

Why it matters

This plugin allows Nightscout to go beyond raw graphs:

  • It provides natural-language explanations of glucose patterns.
  • It highlights fluctuations, stability issues, and potential improvements.
  • It adds an intelligent summary layer to complement traditional reporting.

More information

https://github.com/xannasavin/cgm-remote-monitor/blob/feat/ai-report-plugin/ai_evaluation.md


Screenshots

Admin Prompt Settings

Image

Usage Statistics

Image

AI Evaluation Tab

Image

During Sending

Image

Results
Summary

Image

Single Day

Image

Usage Statistic for current run

Image


I’d love to hear feedback from the community: is this something you’d like to see integrated into Nightscout?
If yes, what would be the next steps?
For sure someone would need to make a code review of this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions