Skip to content

About

F1 telemetry analysis tool with multimodal input and automatic reports, made with Streamlit. Submodule of F1-StratLab.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

F1 Telemetry Manager

FastAPI backend and React web app (post-race UI) for F1 StratLab.

License Python FastAPI React Vite FastMCP Ask DeepWiki

Parent project: F1 StratLab · Architecture · Backend API reference · Changelog


What it is

F1 Telemetry Manager is the post-race surface of F1 StratLab: a FastAPI backend that wraps the strategy agents (N25–N31) and the telemetry / comparison / circuit-domination services, and a React web app (Vite + TypeScript + Tailwind + ECharts) that consumes them. It is vendored into F1 StratLab as a git submodule at src/telemetry/ and shares the parent's data root, ML weights, and .env.

The backend can be tested standalone, but the chat and strategy endpoints assume the F1 StratLab source, data, and model files live alongside this submodule.

Two surfaces

Surface Entry point What it does
FastAPI backend uv run uvicorn backend.main:app --port 8000 REST endpoints for telemetry, comparison, circuit domination, strategy and chat. Mounts a FastMCP server at /mcp exposing the strategy agents as tools.
React web app docker compose up (service webapp) or cd webapp && npm run dev Post-race SPA: telemetry dashboard, 60fps driver comparison, ML model lab, multi-agent strategy, race analysis, and a streaming AI chat that renders tool results (cards + ECharts) inline. Reports, sessions, image attach.

The chat pipeline runs in-process against the strategy agents through a tool-calling loop (OpenAI tool contract); the same tools are exposed externally over MCP, so Claude Desktop, Cursor or any MCP client can drive the agents directly.

How to run

From the F1 StratLab repo root (recommended):

docker compose up

docker compose up brings the backend up on :8000 and the React web app on :8501. The legacy Streamlit and voice surfaces are not part of main; their last complete submodule tree is preserved in this repository's legacy_version branch.

The submodule Compose file is intended to run from a parent F1 StratLab checkout. It mounts ../../src and ../../data from that checkout and reads ../../.env for the LLM provider. Use the parent docker-compose.yml as the canonical command; the submodule file is useful when selecting only these two services.

Manual install for development:

uv sync --frozen --extra dev
uv run uvicorn backend.main:app --reload --port 8000   # terminal 1
cd webapp && npm install && npm run dev                # terminal 2 (web app on :5173)

Requires Python 3.11 or 3.12.

What the backend exposes

All endpoints sit under /api/v1. The full reference lives at docs/pages/backend-api.md in the parent repo; the short version:

  • /telemetry: GPs, sessions, drivers, lap times, per-lap telemetry, aggregated data (FastF1).
  • /comparison/compare, two-driver fastest-lap comparison with synchronised delta.
  • /circuit-domination, microsector-level dominant-driver map.
  • /strategy, pace, tire degradation, situation, pit timing, radio NLP, FIA RAG and the orchestrated recommend endpoint that ties them together. Also drives the simulator (/strategy/simulate).
  • Season-scoped regulation chat, where query_regulations and POST /api/v1/strategy/rag accept an optional year. Omitting it keeps the historical unscoped lookup; supplying it selects the matching FIA rulebook.
  • /chat, message, stream, tool-message and tool-message-stream. The tool-message endpoints implement the OpenAI tool-calling loop against the strategy MCP tools; /stream is the plain chat passthrough.
  • /mcp: FastMCP Streamable-HTTP transport. External MCP clients connect here to call the strategy tools directly.

The voice chat surface (STT → LLM → TTS) was retired in v2. It remains available in this repository's legacy_version branch. The current main surface is text chat plus the team-radio transcript pipeline; radio audio is not interactive voice chat.

Project layout

  • backend/: FastAPI app
    • api/v1/endpoints/: telemetry, comparison, circuit_domination, strategy, chat
    • services/, chatbot (chat engine, MCP bridge, stage tracker, LLM service), telemetry, simulation
    • mcp_tools.py: FastMCP server wrapping the N25–N31 agents
  • webapp/: React web app (Vite + TypeScript + Tailwind + ECharts)
  • docs/, architecture, changelog, multimodal and MCP notes
  • tests/, pytest coverage for chat engine, MCP bridge, comparison and telemetry services

Tech stack

Backend: FastAPI 0.136, Pydantic 2.13, FastF1 3.4, FastMCP 3.2. Frontend (web app): React 19, Vite, TypeScript, Tailwind v4, ECharts, TanStack Router/Query, Zustand. AI: OpenAI-compatible LLM (LM Studio local server or OpenAI API).

Frontend migration, done (v2)

The backend stays FastAPI, no question, and the Streamlit frontend has been replaced by a modern React web app (Vite + TypeScript + Tailwind v4 + ECharts + TanStack Router/Query). It keeps the original structure, menus and flows, but escapes Streamlit's design constraints: instant client-side navigation, a 60fps canvas replay, a redesigned pit-wall aesthetic, and a chat that streams the LLM reply for real over SSE and renders each tool's output (cards + charts) inline. The web app is now the only post-race surface; the legacy Streamlit and voice implementations are preserved on the legacy_version branch of this repository.

Related

This repo is one piece of F1 StratLab:

  • F1 StratLab, strategy engine, agents, CLI and Arcade live UI
  • F1 Telemetry Manager (this repo), backend and post-race React web app, vendored as a submodule
  • F1 AI Team Detection: YOLOv12 team identification from race footage
  • F1 Strategy Dataset, trained weights and processed race data

About

Originally built as a coursework project (Santiago Souto Ortega and Víctor Vega Sobral, fourth year, Grado en Ingeniería de Sistemas Inteligentes) and later refactored into the post-race surface of F1 StratLab. Pull requests and issues are welcome at VforVitorio/F1_Telemetry_Manager.

Licensed under the Apache License 2.0, see LICENSE.


Disclaimer, no copyright infringement intended. Formula 1, F1 and related marks are trademarks of Formula One Licensing B.V. and are used here for reference only. Race data is sourced from public APIs (FastF1) and used strictly for educational and non-commercial purposes. This project is not affiliated with, endorsed by, or in any way officially connected to Formula 1, the FIA, or any F1 team.

About

F1 telemetry analysis tool with multimodal input and automatic reports, made with Streamlit. Submodule of F1-StratLab.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages