f1 strat manager complete - VforVitorio/F1_Strat_Manager GitHub Wiki

F1 Strategy Manager - Complete Documentation

This document contains the complete documentation for the F1 Strategy Manager project, organized in a hierarchical structure.

Table of Contents

NLP Pipeline

Expert System

Developer Guide

Other Sections


Radio Message Rules

Relevant source files

2.1. Sentiment Analysis Model

The sentiment model classifies radio messages into three categories:

  • Positive
  • Negative
  • Neutral

2.2. Intent Classification Model

The intent model categorizes messages into five types:

  • INFORMATION: Factual updates about race conditions
  • PROBLEM: Driver-reported issues
  • ORDER: Direct instructions to the driver
  • WARNING: Alerts about potential issues
  • QUESTION: Queries requiring driver input

2.3. Named Entity Recognition

The NER model identifies key entities in radio messages using the BIO (Beginning-Inside-Outside) tagging scheme:

Entity Type Description
ACTION Direct commands or actions
SITUATION Racing context descriptions
INCIDENT Accidents or on-track events
STRATEGY_INSTRUCTION Strategic directives
POSITION_CHANGE References to positions
PIT_CALL Calls for pit stops
TRACK_CONDITION Track state mentions
TECHNICAL_ISSUE Car-related problems
WEATHER Weather conditions

2.4. Pipeline Integration

The complete pipeline combines these models to produce structured data:

Example structured output:

3. Radio Rules Implementation

The F1RadioRules class extends the base F1StrategyEngine and implements three main rules that trigger specific strategy recommendations based on radio analysis.

3.1. Grip Issue Response Rule

This rule detects when a driver reports grip problems or technical issues with the car. Conditions:

  • Radio message has negative sentiment
  • Contains grip-related terms or TECHNICAL_ISSUE entities Action:
  • Recommends prioritizing a pit stop with 85% confidence
  • Medium-high priority (2 out of 3)

3.2. Weather Information Adjustment Rule

This rule identifies when weather changes are reported that might require strategy adjustments. Conditions:

  • Contains WEATHER entities
  • OR contains TRACK_CONDITION entities mentioning "wet" Action:
  • Recommends preparing rain tires with 90% confidence
  • High priority (3 out of 3)

3.3. Incident Reaction Rule

This rule detects safety car deployments or yellow flag situations. Conditions:

  • Contains INCIDENT entities with "safety" reference
  • OR contains SITUATION entities with "yellow" reference Action:
  • Recommends reevaluating pit window with 85% confidence
  • High priority (3 out of 3)

4. Integration Flow

The following diagram illustrates how radio messages are processed by the system, from input to strategy recommendation:

5. Example Usage and Testing

The system can be tested with different radio message scenarios to verify rule activation:

The test_radio_rules function demonstrates the full pipeline:

  1. Analyze the radio message using NLP
  2. Create a RadioFact from the analysis
  3. Run the F1RadioRules engine with the fact
  4. Return strategy recommendations

6. Transcription Capability

For processing audio radio communications, the system includes a transcription module based on OpenAI's Whisper model:

The transcription process converts audio messages to text before running them through the same analysis pipeline. Example usage:

7. Performance and Limitations

The Radio Message Rules system has the following characteristics:

  1. Strengths:
    • Integrates qualitative driver feedback into quantitative strategy
    • Handles both text and audio inputs
    • Rapidly identifies critical race conditions (weather, incidents)
  2. Limitations:
    • Effectiveness depends on NLP model accuracy
    • Relies on specific linguistic patterns and keywords
    • May miss nuanced or complex communications
  3. Error Handling:
    • Confidence scores indicate rule certainty

Sentiment and Intent Analysis

Relevant source files

Sentiment Analysis Model

The system uses a fine-tuned RoBERTa-base model to classify radio messages into three sentiment categories: positive, neutral, and negative. This sentiment information helps the strategy engine understand the emotional context of communications, which can inform decisions about driver management and race approach.

Model Architecture

RoBERTa (Robustly Optimized BERT Pretraining Approach) was selected for its superior performance on sentiment analysis tasks and ability to understand domain-specific language like F1 radio communications.

Model Training

The sentiment model was fine-tuned on a dataset of 530 manually labeled F1 radio messages with the following distribution:

Sentiment Count Percentage
Neutral 379 71.5%
Negative 101 19.1%
Positive 50 9.4%
The model was trained using a cross-entropy loss function with class weighting to handle the class imbalance. The training process involved:
  1. Splitting data into train (70%), validation (15%), and test (15%) sets
  2. Tokenizing with a maximum sequence length of 128 tokens
  3. Fine-tuning the pre-trained RoBERTa-base model
  4. Early stopping based on validation loss

Prediction Function

The model uses the following function to predict sentiment from text:

Intent Classification

The intent classification model categorizes radio messages based on their communicative purpose, using a fine-tuned RoBERTa-large model.

Intent Categories

The system recognizes five distinct intent types:

Intent Type Description Example
INFORMATION Factual updates about race conditions "Hamilton is 2 seconds behind"
PROBLEM Messages indicating issues "My left wing is broken"
ORDER Direct instructions to the driver "Box this lap for softs"
WARNING Alerts about potential issues "Watch your fuel consumption"
QUESTION Queries requiring driver input "How are the tyres feeling?"

Model Implementation

The intent classifier uses the same architectural approach as the sentiment model but with RoBERTa-large as the base model for improved performance on this more complex task:

Integrated Radio Analysis Pipeline

The system combines sentiment analysis, intent classification, and named entity recognition into a unified pipeline to extract comprehensive information from each radio message.

Pipeline Architecture

Output Format

The pipeline generates a standardized JSON output containing the original message and complete analysis:

Integration with Strategy Engine

The sentiment and intent analysis system feeds directly into the F1 Strategy Engine, providing critical context for strategic decision-making during races.

Key Use Cases

Radio analysis enhances strategic decision-making in several key ways:

  1. Driver Mood Detection: Sentiment analysis identifies driver stress or confidence levels, allowing appropriate strategy adjustments
  2. Action Prioritization: Intent classification distinguishes between urgent orders and routine information
  3. Information Extraction: Entity recognition pulls out specific information like track conditions or technical issues
  4. Competitor Intelligence: Analysis of team radio from other drivers can reveal strategy intentions

Model Loading and Inference

The system defines utility functions to load and run inference with the trained models:

Model Loading

The load_sentiment_model(), load_intent_model(), and load_bert_ner_model() functions handle model loading with appropriate configurations:

Prediction Process

The overall prediction process is streamlined through the analyze_radio_message() function:

Named Entity Recognition

Relevant source files

2. Entity Types

The F1 NER system recognizes nine domain-specific entity types, each capturing critical information for race strategy:

Entity Type Description Example
ACTION Direct commands or actions "push now", "follow my instruction"
SITUATION Racing context or circumstances "Hamilton is 2 seconds behind"
INCIDENT Accidents or on-track events "Ferrari in the wall"
STRATEGY_INSTRUCTION Strategic directives "We're looking at Plan B"
POSITION_CHANGE References to overtakes or positions "You're P4", "gaining on Verstappen"
PIT_CALL Specific pit stop instructions "Box this lap"
TRACK_CONDITION Mentions of track state "yellows in turn 7", "track is drying"
TECHNICAL_ISSUE Car-related problems "losing grip on the rear"
WEATHER Weather conditions "rain expected in 5 minutes"

3. Technical Implementation

The NER component implements a fine-tuned BERT model customized for the F1 domain with a BIO (Beginning-Inside-Outside) tagging scheme.

3.1 BIO Tagging Approach

The NER system uses BIO tagging, a standard approach in sequence labeling:

  • B-: Marks the Beginning of an entity
  • I-: Marks the Inside (continuation) of an entity
  • O: Marks tokens Outside any entity For example, the message "Ferrari in the wall, no? Yes, that's Charles stopped" would be tagged as: | Word | Tag | | ------- | ---------- | | Ferrari | B-INCIDENT | | in | I-INCIDENT | | the | I-INCIDENT | | wall | I-INCIDENT | | , | O | | no | O | | ? | O | | Yes | O | | , | O | | that's | B-INCIDENT | | Charles | I-INCIDENT | | stopped | I-INCIDENT |

3.2 Model Architecture

The NER system uses a BERT-based token classification model:

The technical components include:

  1. Base Model: BERT-large-cased-finetuned-conll03-english
  2. Customization: Fine-tuned on annotated F1 radio communications
  3. Output Layer: 19 output classes (B- and I- for each of the 9 entity types, plus O)
  4. Training Approach: Focused fine-tuning with class weights to handle entity imbalance

4. Data Processing Pipeline

The NER system transforms raw text into structured entity data through several processing steps:

Key steps in the process:

  1. Tokenization: The raw text is tokenized using BERT's WordPiece tokenizer
  2. Prediction: Tokens are processed through the model to predict BIO tags
  3. Entity Extraction: Consecutive tokens with matching entity types are combined

6. Example Output

Here's an example of a processed radio message showing the full pipeline output:

This structured output enables the expert system to understand:

  • The message contains a pit stop instruction (ORDER intent)
  • The emotional tone is neutral
  • There are specific actions (box), pit instructions (this lap for softs), and a situational update (Hamilton is catching up)

7. From NER to Strategy Decisions

The NER-extracted entities directly inform strategic decision-making in the expert system:

Examples of how NER-extracted information influences strategy:

  • PIT_CALL entities: Trigger pit stop preparation rules
  • TRACK_CONDITION entities: Activate weather strategy adjustment rules
  • TECHNICAL_ISSUE entities: Inform tire management or defensive driving recommendations
  • POSITION_CHANGE entities: Update race situation awareness for overtake opportunities

8. Implementation Details

The F1 NER system is implemented using the following key technologies and patterns:

  1. Data Preparation:
    • Character-span annotation to BIO tag conversion
    • Custom tokenization handling for BERT model
  2. Model Configuration:
    • BertForTokenClassification with custom classification head
    • Entity-specific class weighting to handle imbalance
  3. Inference Functions:
    • analyze_f1_radio(): Main function for entity extraction
    • Custom post-processing to merge BIO tags into entities
  4. Integration Interface:
    • Module organization: NLP_utils/N05_ner_models.py
    • Integration point: analyze_radio_message() in N06_model_merging.py

9. Usage in the Strategy System

The structured entity information from the NER component is consumed by the F1 Strategy Engine as RadioFact objects, which trigger specific rules in the expert system:

The NER results inform strategic decisions such as:

  • When to pit based on weather changes mentioned in radio

Integrated Rule Engine

Relevant source files

Fact Types and Knowledge Representation

The rule engine operates on various fact types that represent different aspects of race strategy. These facts are created from raw data and serve as the input to the rule engine.

Core Components

F1CompleteStrategyEngine Class

The F1CompleteStrategyEngine class is the central component that inherits from all specialized rule engines and adds conflict resolution capabilities. Key features:

  • Multiple Inheritance: Inherits all rules from specialized engines
  • Active Systems Tracking: Monitors which rule systems have fired rules
  • Enhanced Recommendation Processing: Adds conflict resolution to recommendations

Active Systems Tracking

The integrated engine tracks which specialized rule systems have fired rules. This information is valuable for:

  • Debugging which parts of the system are active
  • Providing context for recommendations
  • Understanding the basis for strategic decisions

Conflict Resolution Mechanism

A key feature of the integrated engine is its ability to resolve conflicting recommendations. This is critical in F1 strategy where different data sources might suggest contradictory actions.

Conflict Resolution Process

Conflicting Action Pairs

The engine defines specific pairs of actions that are considered mutually exclusive:

Action Pair Conflict Reason
extend_stint + pit_stop Cannot extend stint and pit at the same time
extend_stint + prioritize_pit Cannot extend stint and prioritize pitting
extend_stint + defensive_pit Cannot extend stint and make a defensive pit
extend_stint + consider_pit Cannot extend stint and consider pitting
prepare_pit + pit_stop No need to prepare if immediate pit is recommended
prepare_pit + prioritize_pit No need to prepare if prioritized pit is recommended
perform_undercut + perform_overcut Cannot do undercut and overcut simultaneously
When conflicting recommendations are detected, the engine selects the one with higher priority and confidence.

Fact Transformation Pipeline

The integrated engine requires properly formatted facts. The transform_all_facts function serves as a comprehensive pipeline for converting raw data into facts.

Complete Strategy Analysis Pipeline

The analyze_strategy function provides an end-to-end pipeline for F1 strategy analysis. It integrates all components of the system:

  1. Data Loading: Loads data from various sources
  2. Fact Transformation: Converts data into facts for the rule engine
  3. Rule Execution: Runs the integrated rule engine
  4. Recommendation Generation: Produces prioritized strategy recommendations

Example Usage

The Integrated Rule Engine can be used through the analyze_strategy function, which provides a complete pipeline from raw data to strategy recommendations:

The output is a list of prioritized strategy recommendations that have been processed through the conflict resolution mechanism:

Recommendation 1:
  Action: pit_stop
  Confidence: 0.85
  Priority: 3
  Explanation: Tire performance cliff detected. Model predicts 0.75s slowdown...
Recommendation 2:
  Action: defensive_pit
  Confidence: 0.80
  Priority: 2
  Explanation: Defensive pit stop strongly recommended in mid stint...

Integration with UI

The Integrated Rule Engine is accessed from the Streamlit dashboard via components that call the analyze_strategy function or related utilities:

In the Streamlit dashboard, the "Run Strategy Analysis for All Drivers" button triggers the integrated rule engine for all drivers, generating comprehensive strategy recommendations that are displayed in the UI.

Best Practices for Extending the Rule Engine

  1. Maintaining Rule System Separation: Keep specialized rules in their respective classes to maintain modularity.
  2. Naming Convention for Rules: Use consistent prefixes for rule names (e.g., high_degradation_*) to ensure proper rule system tracking.
  3. Consistent Recommendation Structure: All recommendations should include action, confidence, explanation, and priority for proper conflict resolution.
  4. Updating Conflict Pairs: When adding new action types, update the conflicting_pairs list in _resolve_conflicts to define their relationships with existing actions.
  5. Fact Validation: Always validate facts before declaring them to the engine to avoid schema validation errors.

Conclusion

The Integrated Rule Engine is the cornerstone of the F1 Strategy Manager, providing a unified framework for evaluating diverse sources of race information and generating coherent strategy recommendations. By combining specialized rule systems with sophisticated conflict resolution, it enables comprehensive strategy analysis that considers tire degradation, lap times, gaps between cars, and radio communications. The modular architecture allows for easy extension with new rule systems while maintaining a consistent recommendation framework.


Integration Guide

Relevant source files

2. Adding New Data Sources

The first step in extending the system is to add new data sources and create transformation functions to convert the data into facts that the rule engine can process.

2.1 Data Source Requirements

New data sources should provide one or more of the following types of information:

  • Telemetry data (lap times, tire age, etc.)
  • Gap information between cars
  • Degradation predictions
  • Radio communications
  • Race status information

2.2 Creating Transformation Functions

You need to create a transformation function that converts your data into fact objects. Follow this pattern:

2.3 Implementation Steps

  1. Create a new loader function for your data source
  2. Create a transformation function that converts the data into facts
  3. Add your transformation function to transform_all_facts() Example of adding a new transformation function:

Then, update the transform_all_facts() function to include your new transformation:

3. Creating Custom Fact Classes

If your data doesn't fit into existing fact classes, you'll need to create a new fact class.

4.2 Implementation Steps

  1. Create a new class that inherits from F1StrategyEngine
  2. Define rules using the @Rule decorator from Experta
  3. Implement methods that execute when rules are triggered Example of a custom rule system:

5. Integrating with the Complete Strategy Engine

After creating your custom rule system, you need to integrate it with the F1CompleteStrategyEngine.

5.1 Updating the Complete Strategy Engine

  1. Modify the class definition to include your rule system
  2. Update the record_rule_fired method to track your rule system
  3. Update the active_systems dictionary initialization

5.2 Updating Conflict Resolution

You may need to update the conflict resolution mechanism in _resolve_conflicts method if your new rules can potentially conflict with existing rules:

6. Testing Integration

Testing is crucial to ensure that your new components integrate properly with the system.

6.1 Testing Transformation Functions

Create test functions to verify that your transformation functions correctly convert data to facts:

6.2 Testing Rule Activation

Test that your rules are correctly activated when conditions are met:

6.3 Integration Testing

Finally, test that your components work within the complete system:

7. Complete Integration Flow

The following diagram provides an end-to-end view of the integration process, from loading data to generating recommendations:

8. Common Integration Issues and Solutions

Issue Possible Cause Solution
Rules not activating Missing or incorrectly formatted facts Verify fact structure with print statements, ensure all required fields are present
Type errors in facts Incorrect data types in transformation functions Add explicit type conversion in transformation functions (e.g., int(), float())
Recommendations not showing up Conflicts being resolved against your rules Check conflict resolution, adjust priorities or confidence levels
Integration exceptions Import path issues Make sure your modules are in the Python path, use absolute imports
Duplicate rules firing Multiple rule systems handling same condition Use more specific rule conditions, add mutual exclusion constraints

9. Best Practices for Integration

  1. Follow Naming Conventions: Use consistent prefixes for your rule methods (e.g., weather_* for weather rules)
  2. Document Everything: Add detailed docstrings to all new functions, methods, and classes
  3. Handle Errors Gracefully: Wrap transformation functions in try-except blocks to prevent failure cascades
  4. Test Incrementally: Test each component separately before full integration
  5. Be Mindful of Performance: Avoid expensive operations in rule conditions as they evaluate frequently
  6. Maintain Backward Compatibility: Don't modify existing fact structures, extend them instead
  7. Use Debug Flags: Add debug parameters to transformation functions for easier troubleshooting

Summary

This integration guide provides the foundation for extending the F1 Strategy Manager with new data sources, models, and rules. By following the outlined steps and patterns, you can add new capabilities while maintaining compatibility with the existing system.


Documentation

Purpose and Scope

The F1 Strategy Manager combines telemetry data analysis, computer vision, natural language processing, and rule-based expert systems to:

  1. Analyze real-time race data from multiple sources

Key Components

Data Sources and Processing

The system ingests and processes data from three primary sources:

  1. Race Telemetry (FastF1): Lap times, sector data, tire information
  2. Team Radio (OpenF1): Audio transcripts from driver-team communications
  3. Video Footage: Raw race footage for gap calculation and position tracking Data processing is managed through the utils/processing.py module, which contains functions for transforming raw data into analysis-ready formats: | Function | Purpose | Source File | | --------------------------------- | ----------------------------------------------------------------------- | ------------- | | get_processed_race_data() | Transforms race telemetry with fuel adjustments and degradation metrics | processing.py | | get_processed_gap_data() | Calculates gap consistency between cars | processing.py |

Streamlit Interface

The user interface is built with Streamlit and provides multiple specialized views:

  1. Strategy Recommendations View: Displays AI-powered recommendations
  2. Gap Analysis View: Visualizes gaps between cars and identifies strategic opportunities
  3. Radio Analysis View: Shows insights from team radio communications
  4. Time Predictions View: Displays lap time predictions
  5. Tire Degradation View: Analyzes tire wear patterns and performance impacts The UI components are organized in the components directory, with each view implemented as a separate module.

Data Flow

The following diagram illustrates how data flows through the system from input sources to the user interface:

Key steps in the data flow:

  1. Data Acquisition: Raw data is collected from multiple sources
  2. Processing: The processing.py module transforms raw data into standardized formats
  3. Analysis: Machine learning models generate predictions and insights
  4. Rule Evaluation: The expert system applies rules to generate recommendations
  5. Visualization: The UI components render the processed data and recommendations

/

powered by Devin Add repo microsoft/vscode Visual Studio Code 170.1k mark3labs/mcp-go A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools. 3.4k antiwork/gumroad 5.2k langchain-ai/local-deep-researcher Fully local web research and report writing assistant 7.0k meta-llama/llama-models Utilities intended for use with Llama models. 6.8k huggingface/transformers 🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX. 143.1k langchain-ai/langchain 🦜🔗 Build context-aware reasoning applications 105.8k expressjs/express lodash/lodash A modern JavaScript utility library delivering modularity, performance, & extras. 60.3k sqlite/sqlite Official Git mirror of the SQLite source tree 7.7k microsoft/monaco-editor A browser based code editor 42.1k openai/openai-agents-python A lightweight, powerful framework for multi-agent workflows 8.8k openai/openai-python The official Python library for the OpenAI API 26.3k anthropics/anthropic-sdk-python 1.9k microsoft/markitdown Python tool for converting files and office documents to Markdown. 49.2k hydralauncher/hydra Hydra is a game launcher with its own embedded bittorrent client 12.3k redis/redis microsoft/BitNet Official inference framework for 1-bit LLMs 13.2k infiniflow/ragflow RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding. 49.3k localsend/localsend An open-source cross-platform alternative to AirDrop 60.1k colinhacks/zod TypeScript-first schema validation with static type inference 37.1k mermaid-js/mermaid Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown 78.2k microsoft/playwright Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. 71.7k remy/nodemon Monitor for any changes in your node.js application and automatically restart the server - perfect for development 26.5k mlflow/mlflow Open source platform for the machine learning lifecycle 20.2k freeCodeCamp/freeCodeCamp freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free. 416.6k codecrafters-io/build-your-own-x Master programming by recreating your favorite technologies from scratch. 372.1k EbookFoundation/free-programming-books 📚 Freely available programming books 355.0k public-apis/public-apis A collective list of free APIs 335.7k jwasham/coding-interview-university A complete computer science study plan to become a software engineer. 314.4k kamranahmedse/developer-roadmap Interactive roadmaps, guides and other educational content to help developers grow in their careers. 313.8k donnemartin/system-design-primer Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. 296.5k 996icu/996.ICU Repo for counting stars and contributing. Press F to pay respect to glorious developers. 270.5k facebook/react The library for web and native user interfaces. 234.7k practical-tutorials/project-based-learning Curated list of project-based tutorials 224.5k vuejs/vue This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core 208.7k TheAlgorithms/Python All Algorithms implemented in Python 199.5k torvalds/linux Linux kernel source tree 191.8k trekhleb/javascript-algorithms 📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings 191.0k tensorflow/tensorflow An Open Source Machine Learning Framework for Everyone 189.4k getify/You-Dont-Know-JS A book series (2 published editions) on the JS language. 181.8k CyC2018/CS-Notes 📚 技术面试必备基础知识、Leetcode、计算机操作系统、计算机网络、系统设计 179.8k ossu/computer-science 🎓 Path to a free self-taught education in Computer Science! 178.2k Significant-Gravitas/AutoGPT AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters. 174.5k twbs/bootstrap The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. 172.2k flutter/flutter Flutter makes it easy and fast to build beautiful apps for mobile and beyond 169.8k github/gitignore A collection of useful .gitignore templates 165.8k jackfrued/Python-100-Days Python - 100天从新手到大师 164.1k trimstray/the-book-of-secret-knowledge A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools and more. 163.3k jlevy/the-art-of-command-line Master the command line, in one page 155.6k AUTOMATIC1111/stable-diffusion-webui Stable Diffusion web UI 151.3k Snailclimb/JavaGuide 「Java学习+面试指南」一份涵盖大部分 Java 程序员所需要掌握的核心知识。准备 Java 面试,首选 JavaGuide! 149.2k airbnb/javascript JavaScript Style Guide 146.6k ollama/ollama Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 3, Mistral Small 3.1 and other large language models. 137.6k ytdl-org/youtube-dl Command-line program to download videos from YouTube.com and other video sites 135.2k massgravel/Microsoft-Activation-Scripts Open-source Windows and Office activator featuring HWID, Ohook, TSforge, KMS38, and Online KMS activation methods, along with advanced troubleshooting. 131.3k vercel/next.js The React Framework 131.1k labuladong/fucking-algorithm 刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why. 127.6k golang/go The Go programming language 127.2k yangshun/tech-interview-handbook 💯 Curated coding interview preparation materials for busy software engineers 125.3k Chalarangelo/30-seconds-of-code Coding articles to level up your development skills 123.4k facebook/react-native A framework for building native applications using React 121.6k Genymobile/scrcpy Display and control your Android device 120.7k microsoft/PowerToys Windows system utilities to maximize productivity 117.4k electron/electron :electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS 116.4k kubernetes/kubernetes Production-Grade Container Scheduling and Management 114.5k justjavac/free-programming-books-zh_CN 📚 免费的计算机编程类中文书籍,欢迎投稿 113.4k krahets/hello-algo 《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 代码。简体版和繁体版同步更新,English version ongoing 111.7k nodejs/node Node.js JavaScript runtime ✨🐢🚀✨ 110.6k d3/d3 Bring data to life with SVG, Canvas and HTML. 📊📈🎉 110.4k yt-dlp/yt-dlp A feature-rich command-line audio/video downloader 107.9k axios/axios Promise based HTTP client for the browser and node.js 106.7k microsoft/TypeScript TypeScript is a superset of JavaScript that compiles to clean JavaScript output. 104.0k facebook/create-react-app Set up a modern web app by running one command. 103.2k rust-lang/rust Empowering everyone to build reliable and efficient software. 102.8k denoland/deno A modern runtime for JavaScript and TypeScript. 102.6k goldbergyoni/nodebestpractices ✅ The Node.js best practices list (July 2024) 102.4k 521xueweihan/HelloGitHub 101.5k microsoft/terminal The new Windows Terminal and the original Windows console host, all in the same place! 97.7k excalidraw/excalidraw Virtual whiteboard for sketching hand-drawn like diagrams 97.7k angular/angular Deliver web apps with confidence 🚀 97.5k godotengine/godot Godot Engine – Multi-platform 2D and 3D game engine 96.3k deepseek-ai/DeepSeek-V3 95.7k mui/material-ui Material UI: Comprehensive React component library that implements Google's Material Design. Free forever. 95.4k ripienaar/free-for-dev A list of SaaS, PaaS and IaaS offerings that have free tiers of interest to devops and infradev 94.7k ant-design/ant-design An enterprise-class UI design language and React UI library 94.3k ryanmcdermott/clean-code-javascript Clean Code concepts adapted for JavaScript 92.8k fatedier/frp A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet. 92.7k iptv-org/iptv Collection of publicly available IPTV channels from all over the world 92.5k langgenius/dify Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you q... 92.4k papers-we-love/papers-we-love Papers from the computer science community to read and discuss. 92.4k tauri-apps/tauri Build smaller, faster, and more secure desktop and mobile applications with a web frontend. 91.6k nvbn/thefuck Magnificent app which corrects your previous console command. 91.5k iluwatar/java-design-patterns Design patterns implemented in Java 91.3k puppeteer/puppeteer JavaScript API for Chrome and Firefox 90.4k open-webui/open-webui User-friendly AI Interface (Supports Ollama, OpenAI API, ...) 89.9k PanJiaChen/vue-element-admin 🎉 A magical vue admin https://panjiachen.github.io/vue-element-admin 89.1k pytorch/pytorch Tensors and Dynamic neural networks in Python with strong GPU acceleration 89.1k neovim/neovim Vim-fork focused on extensibility and usability 88.7k deepseek-ai/DeepSeek-R1 88.5k microsoft/Web-Dev-For-Beginners 24 Lessons, 12 Weeks, Get Started as a Web Developer 87.3k tailwindlabs/tailwindcss A utility-first CSS framework for rapid UI development. 87.2k rustdesk/rustdesk An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer. 86.9k mtdvio/every-programmer-should-know A collection of (mostly) technical things every software developer should know about 86.9k storybookjs/storybook Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation 86.4k shadcn-ui/ui A set of beautifully-designed, accessible components and a code distribution platform. Works with your favorite frameworks. Open Source. Open Code. 85.5k nvm-sh/nvm Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions 84.0k fastapi/fastapi FastAPI framework, high performance, easy to learn, fast to code, ready for production 83.4k django/django The Web framework for perfectionists with deadlines. 83.2k florinpop17/app-ideas A Collection of application ideas which can be used to improve your coding skills. 82.9k bitcoin/bitcoin Bitcoin Core integration/staging tree 82.9k ChatGPTNextWeb/NextChat ✨ Light and Fast AI Assistant. Support: Web | iOS | MacOS | Android | Linux | Windows 82.8k sveltejs/svelte web development for the rest of us 82.3k n8n-io/n8n Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations. 82.1k gin-gonic/gin Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin. 81.8k opencv/opencv Open Source Computer Vision Library 81.7k animate-css/animate.css 🍿 A cross-browser library of CSS animations. As easy to use as an easy thing. 81.6k gothinkster/realworld "The mother of all demo apps" — Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more 81.4k supabase/supabase The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. 81.0k laravel/laravel Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things. 80.6k openai/whisper Robust Speech Recognition via Large-Scale Weak Supervision 80.1k macrozheng/mall mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于Spring Boot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。 79.9k gohugoio/hugo The world’s fastest framework for building websites. 79.6k tonsky/FiraCode Free monospaced font with programming ligatures 78.7k microsoft/generative-ai-for-beginners 21 Lessons, Get Started Building with Generative AI 🔗 https://microsoft.github.io/generative-ai-for-beginners/ 78.5k ggml-org/llama.cpp LLM inference in C/C++ 78.3k 2dust/v2rayN A GUI client for Windows, Linux and macOS, support Xray and sing-box and others 78.2k oven-sh/bun Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one 77.5k tensorflow/models Models and examples built with TensorFlow 77.5k doocs/advanced-java 😮 Core Interview Questions & Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识 77.5k spring-projects/spring-boot Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss. 76.8k 3b1b/manim Animation engine for explanatory math videos 76.8k MisterBooo/LeetCodeAnimation Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路) 75.8k FortAwesome/Font-Awesome The iconic SVG, font, and CSS toolkit 74.9k comfyanonymous/ComfyUI The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. 74.5k netdata/netdata X-Ray Vision for your infrastructure! 74.3k typicode/json-server Get a full fake REST API with zero coding in less than 30 seconds (seriously) 74.0k bregman-arie/devops-exercises Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions 74.0k Anduin2017/HowToCook 程序员在家做饭方法指南。Programmer's guide about how to cook at home (Simplified Chinese only). 73.8k nomic-ai/gpt4all GPT4All: Run Local LLMs on Any Device. Open-source and available for commercial use. 73.1k anuraghazra/github-readme-stats ⚡ Dynamically generated stats for your github readmes 72.6k fighting41love/funNLP 中英文敏感词、语言检测、中外手机/电话归属地/运营商查询、名字推断性别、手机号抽取、身份证抽取、邮箱抽取、中日文人名库、中文缩写库、拆字词典、词汇情感值、停用词、反动词表、暴恐词表、繁简体转换、英文模拟中文发音、汪峰歌词生成器、职业名称词库、同义词库、反义词库、否定词库、汽车品牌词库、汽车零件词库、连续英文切割、各种中文词向量、公司名字大全、古诗词库、IT词库、财经词库、成语词库、地名词库、历史名... 72.5k vitejs/vite Next generation frontend tooling. It's fast! 72.1k microsoft/ML-For-Beginners 12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all 71.9k ByteByteGoHq/system-design-101 Explain complex systems using visuals and simple terms. Help you prepare for system design interviews. 71.7k hoppscotch/hoppscotch Open source API development ecosystem - https://hoppscotch.io (open-source alternative to Postman, Insomnia) 71.2k coder/code-server VS Code in the browser 71.1k nestjs/nest A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀 70.5k CompVis/stable-diffusion A latent text-to-image diffusion model 70.4k thedaviddias/Front-End-Checklist 🗂 The perfect Front-End Checklist for modern websites and meticulous developers 69.9k abi/screenshot-to-code Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue) 69.6k moby/moby The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems 69.5k syncthing/syncthing Open Source Continuous File Synchronization 69.5k junegunn/fzf 🌸 A command-line fuzzy finder 69.5k pallets/flask The Python micro framework for building web applications. 69.3k hakimel/reveal.js The HTML Presentation Framework 68.7k base/node Everything required to run your own Base node 68.5k Developer-Y/cs-video-courses List of Computer Science courses with video lectures. 68.5k d2l-ai/d2l-zh 《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。 68.5k swiftlang/swift The Swift Programming Language 68.4k binary-husky/gpt_academic 为GPT/GLM等LLM大语言模型提供实用化交互接口,特别优化论文阅读/润色/写作体验,模块化设计,支持自定义快捷按钮&函数插件,支持Python和C++等项目剖析&自译解功能,PDF/LaTex论文翻译&总结功能,支持并行问询多种LLM模型,支持chatglm3等本地模型。接入通义千问, deepseekcoder, 讯飞星火, 文心一言, llama2, rwkv, claude2, moss... 68.2k grafana/grafana The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.... 67.5k protocolbuffers/protobuf Protocol Buffers - Google's data interchange format 67.3k louislam/uptime-kuma A fancy self-hosted monitoring tool 67.3k sdmg15/Best-websites-a-programmer-should-visit 🔗 Some useful websites for programmers. 66.6k python/cpython The Python programming language 66.3k tesseract-ocr/tesseract Tesseract Open Source OCR Engine (main repository) 66.2k strapi/strapi 🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first. 66.1k ventoy/Ventoy A new bootable USB solution. 66.1k apache/superset Apache Superset is a Data Visualization and Data Exploration Platform 65.8k chartjs/Chart.js Simple HTML5 Charts using the <canvas> tag 65.7k webpack/webpack A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AM... 65.2k leonardomso/33-js-concepts 📜 33 JavaScript concepts every developer should know. 65.0k ocornut/imgui Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies 64.8k ansible/ansible Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud ... 64.8k swisskyrepo/PayloadsAllTheThings A list of useful payloads and bypass for Web Application Security and Pentest/CTF 64.7k kdn251/interviews Everything you need to know to get the job. 64.1k xtekky/gpt4free The official gpt4free repository | various collection of powerful language models | o3 and deepseek r1, gpt-4.5 64.1k immich-app/immich High performance self-hosted photo and video management solution. 63.8k lydiahallie/javascript-questions A long list of (advanced) JavaScript questions, and their explanations ✨ 63.8k sherlock-project/sherlock Hunt down social media accounts by username across social networks 63.7k obsproject/obs-studio OBS Studio - Free and open source software for live streaming and screen recording 63.6k caddyserver/caddy Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS 63.6k apache/echarts Apache ECharts is a powerful, interactive charting and data visualization library for browser 63.3k openai/openai-cookbook Examples and guides for using the OpenAI API 63.2k twitter/the-algorithm Source code for Twitter's Recommendation Algorithm 63.1k Eugeny/tabby A terminal for a more modern age 63.1k keras-team/keras Deep Learning for humans 62.9k kelseyhightower/nocode The best way to write secure and reliable applications. Write nothing; deploy nowhere. 62.6k resume/resume.github.com Resumes generated using the GitHub informations 62.4k FuelLabs/sway 🌴 Empowering everyone to build reliable and efficient smart contracts. 62.4k danielmiessler/SecLists SecLists is the security tester's companion. It's a collection of multiple types of lists used during security assessments, collected in one place. List types include usernames, passwords, URLs, sensi... 62.2k AppFlowy-IO/AppFlowy Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative. 62.1k PKUFlyingPig/cs-self-learning 计算机自学指南 62.1k scikit-learn/scikit-learn scikit-learn: machine learning in Python 61.8k chrislgarry/Apollo-11 Original Apollo 11 Guidance Computer (AGC) source code for the command and lunar modules. 61.6k TheAlgorithms/Java All Algorithms implemented in Java 61.3k reduxjs/redux A JS library for predictable global state management 61.1k Alvin9999/new-pac 翻墙-科学上网、自由上网、免费科学上网、免费翻墙、fanqiang、油管youtube/视频下载、软件、VPN、一键翻墙浏览器,vps一键搭建翻墙服务器脚本/教程,免费shadowsocks/ss/ssr/v2ray/goflyway账号/节点,翻墙梯子,电脑、手机、iOS、安卓、windows、Mac、Linux、路由器翻墙、科学上网、youtube视频下载、youtube油管镜像/免翻墙网站、... 60.5k bradtraversy/design-resources-for-developers Curated list of design and UI resources from stock photos, web templates, CSS frameworks, UI libraries, tools and much more 60.4k atom/atom :atom: The hackable text editor 60.4k h5bp/Front-end-Developer-Interview-Questions A list of helpful front-end related questions you can use to interview potential candidates, test yourself or completely ignore. 60.2k xingshaocheng/architect-awesome 后端架构师技术图谱 60.1k labmlai/annotated_deep_learning_paper_implementations 🧑‍🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), ga... 60.0k adam-p/markdown-here Google Chrome, Firefox, and Thunderbird extension that lets you write email in Markdown and render it before sending. 59.9k nektos/act Run your GitHub Actions locally 🚀 59.8k facebook/docusaurus Easy to maintain open source documentation websites. 59.4k OpenInterpreter/open-interpreter A natural language interface for computers 59.1k lobehub/lobe-chat 🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / DeepSeek / Qwen), Knowledge Base (file upload / knowledge management ... 58.9k jesseduffield/lazygit simple terminal UI for git commands 58.9k shadowsocks/shadowsocks-windows A C# port of shadowsocks 58.8k localstack/localstack 💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline 58.6k alacritty/alacritty A cross-platform, OpenGL terminal emulator. 58.4k prometheus/prometheus The Prometheus monitoring system and time series database. 58.2k meta-llama/llama Inference code for Llama models 58.1k spring-projects/spring-framework Spring Framework 57.9k juliangarnier/anime JavaScript animation engine 57.8k FuelLabs/fuel-core Rust full node implementation of the Fuel v2 protocol. 57.7k rust-lang/rustlings 🦀 Small exercises to get you used to reading and writing Rust code! 57.7k ryanoasis/nerd-fonts Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more 57.3k zed-industries/zed Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. 57.1k nuxt/nuxt The Intuitive Vue Framework. 56.8k browser-use/browser-use Make websites accessible for AI agents 56.4k NationalSecurityAgency/ghidra Ghidra is a software reverse engineering (SRE) framework 56.3k Stirling-Tools/Stirling-PDF #1 Locally hosted web application that allows you to perform various operations on PDF files 56.0k scutan90/DeepLearning-500-questions 深度学习500问,以问答形式对常用的概率知识、线性代数、机器学习、深度学习、计算机视觉等热点问题进行阐述,以帮助自己及有需要的读者。 全书分为18个章节,50余万字。由于水平有限,书中不妥之处恳请广大读者批评指正。 未完待续............ 如有意合作,联系[email protected] 版权所有,违权必究 Tan 2018.0... 55.8k gatsbyjs/gatsby The best React-based framework with performance, scalability and security built in. 55.8k zylon-ai/private-gpt Interact with your documents using the power of GPT, 100% privately, no data leaks 55.6k youngyangyang04/leetcode-master 《代码随想录》LeetCode 刷题攻略:200道经典题目刷题顺序,共60w字的详细图解,视频难点剖析,50余张思维导图,支持C++,Java,Python,Go,JavaScript等多语言版本,从此算法学习不再迷茫!🔥🔥 来看看,你会发现相见恨晚!🚀 55.5k soimort/you-get ⏬ Dumb downloader that scrapes the web 55.5k azl397985856/leetcode LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。) 55.2k langflow-ai/langflow Langflow is a powerful tool for building and deploying AI-powered agents and workflows. 55.2k dair-ai/Prompt-Engineering-Guide 🐙 Guides, papers, lecture, notebooks and resources for prompt engineering 55.1k clash-verge-rev/clash-verge-rev A modern GUI client based on Tauri, designed to run in Windows, macOS and Linux for tailored proxy experience 55.1k tldr-pages/tldr 📚 Collaborative cheatsheets for console commands 54.8k geekan/MetaGPT 🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming 54.7k ageitgey/face_recognition The world's simplest facial recognition api for Python and the command line 54.6k remix-run/react-router Declarative routing for React 54.6k unionlabs/union The trust-minimized, zero-knowledge bridging protocol, designed for censorship resistance, extremely high security, and usage in decentralized finance. 54.4k ElemeFE/element A Vue.js 2.0 UI Toolkit for Web 54.2k traefik/traefik The Cloud Native Application Proxy 54.2k ruanyf/weekly 科技爱好者周刊,每周五发布 54.2k CorentinJ/Real-Time-Voice-Cloning Clone a voice in 5 seconds to generate arbitrary speech in real-time 54.0k jgraph/drawio-desktop Official electron build of draw.io 53.9k AntonOsika/gpt-engineer CLI platform to experiment with codegen. Precursor to: https://lovable.dev 53.9k nocodb/nocodb 🔥 🔥 🔥 Open Source Airtable Alternative 53.8k lencx/ChatGPT 🔮 ChatGPT Desktop Application (Mac, Windows and Linux) 53.7k deepfakes/faceswap Deepfakes Software For All 53.7k ultralytics/yolov5 YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite 53.4k FiloSottile/mkcert A simple zero-config tool to make locally trusted development certificates with any names you'd like. 53.1k commaai/openpilot openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system on 300+ supported cars. 53.1k necolas/normalize.css A modern alternative to CSS resets 53.0k All-Hands-AI/OpenHands 🙌 OpenHands: Code Less, Make More 52.9k gorhill/uBlock uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean. 52.8k psf/requests A simple, yet elegant, HTTP library. 52.8k topjohnwu/Magisk The Magic Mask for Android 52.2k sharkdp/bat A cat(1) clone with wings. 52.2k Z4nzu/hackingtool ALL IN ONE Hacking Tool For Hackers 52.2k golang-standards/project-layout Standard Go Project Layout 51.9k minio/minio MinIO is a high-performance, S3 compatible object store, open sourced under GNU AGPLv3 license. 51.8k BurntSushi/ripgrep ripgrep recursively searches directories for a regex pattern while respecting your gitignore 51.7k Textualize/rich Rich is a Python library for rich text and beautiful formatting in the terminal. 51.7k pmndrs/zustand 🐻 Bear necessities for state management in React 51.7k ionic-team/ionic-framework A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript. 51.6k pi-hole/pi-hole A black hole for Internet advertisements 51.5k google/material-design-icons Material Design icons by Google (Material Symbols) 51.4k Semantic-Org/Semantic-UI Semantic is a UI component framework based around useful principles from natural language. 51.2k google/guava Google core libraries for Java 50.7k withastro/astro The web framework for content-driven websites. ⭐️ Star to support our work! 50.5k meilisearch/meilisearch A lightning-fast search engine API bringing AI-powered hybrid search to your sites and applications. 50.5k mozilla/pdf.js PDF Reader in JavaScript 50.5k tiimgreen/github-cheat-sheet A list of cool features of Git and GitHub. 50.4k JetBrains/kotlin The Kotlin Programming Language. 50.4k wagoodman/dive A tool for exploring each layer in a docker image 50.3k hacksider/Deep-Live-Cam real time face swap and one-click video deepfake with only a single image 50.3k prettier/prettier Prettier is an opinionated code formatter. 50.3k xai-org/grok-1 Grok open release 50.2k sickcodes/Docker-OSX Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers. 50.2k astral-sh/uv An extremely fast Python package and project manager, written in Rust. 50.0k rclone/rclone "rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files 49.9k toeverything/AFFiNE There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and r... 49.8k facebookresearch/segment-anything The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model. 49.8k jgthms/bulma Modern CSS framework based on Flexbox 49.7k vuejs/core 🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. 49.7k ngosang/trackerslist Updated list of public BitTorrent trackers 49.5k marktext/marktext 📝A simple and elegant markdown editor, available for Linux, macOS and Windows. 49.3k mlabonne/llm-course Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks. 49.3k FFmpeg/FFmpeg Mirror of https://git.ffmpeg.org/ffmpeg.git 49.2k etcd-io/etcd Distributed reliable key-value store for the most critical data of a distributed system 49.1k TryGhost/Ghost Independent technology for modern publishing, memberships, subscriptions and newsletters. 49.0k chinese-poetry/chinese-poetry The most comprehensive database of Chinese poetry 🧶最全中华古诗词数据库, 唐宋两朝近一万四千古诗人, 接近5.5万首唐诗加26万宋诗. 两宋时期1564位词人,21050首词。 49.0k romkatv/powerlevel10k A Zsh theme 48.8k ethereum/go-ethereum Go implementation of the Ethereum protocol 48.8k laurent22/joplin Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS. 48.8k cypress-io/cypress Fast, easy and reliable testing for anything that runs in a browser. 48.5k AlistGo/alist 🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。 48.4k PaddlePaddle/PaddleOCR Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and de... 48.4k NARKOZ/hacker-scripts Based on a true story 48.4k appwrite/appwrite Build like a team of hundreds_ 48.2k go-gitea/gitea Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD 48.2k


Documentation

System Components Diagram

Data Flow Architecture

2. Data Sources and Processing Pipeline

The system integrates multiple data sources that are processed through specialized pipelines before being transformed into facts for the expert system.

Data Sources

The F1 Strategy Manager relies on three primary data sources:

  1. FastF1 API: Provides official F1 telemetry data including lap times, tire usage, and driver position
  2. OpenF1 API: Provides team radio communications between drivers and engineers
  3. Race Video Footage: Used for visual gap calculation between cars

Processing Components

Class Hierarchy

Fact Classes Structure

Dashboard Component Structure

Data Processing Flow Within Dashboard

5. Integration Points

The system uses several integration mechanisms to connect components across different layers.

Session State Management

Streamlit's session state is used to manage application state and data caching:

Fact Transformation and Rule Execution

The integration between data processing and the expert system is managed through fact transformation:

7. System Initialization Sequence

The startup sequence of the application is managed through app.py, which initializes all the necessary components:

Summary

The F1 Strategy Manager's architecture integrates multiple data sources and processing pipelines through a modular design centered around an expert system. The system:

  1. Collects data from FastF1, OpenF1, and race video
  2. Processes this data through specialized pipelines for gap calculation, radio analysis, lap time prediction, and tire degradation modeling
  3. Transforms processed data into facts for the rule engine
  4. Applies domain-specific rules through the F1CompleteStrategyEngine
  5. Resolves conflicts between competing strategy recommendations
  6. Presents the results through an interactive Streamlit dashboard This architecture enables the system to provide comprehensive strategy recommendations that take into account all aspects of Formula 1 racing, from tire wear to gap dynamics and team communications.

Documentation

Dashboard Architecture

The dashboard is built with Streamlit, a Python framework for creating data applications. It follows a modular design with separate components for each analysis view, connected through a central navigation system.

Data Selection

The sidebar also contains controls for data selection, allowing users to:

  • View race information (currently fixed to "Spain 2023")
  • Select a driver to analyze (from available drivers in the dataset) When a new driver is selected, the relevant data is reloaded and processed for the selected driver.

Data Flow

The dashboard implements a data flow pattern that loads, processes, and visualizes race data and strategic recommendations. Data is cached in the Streamlit session state to improve performance when navigating between views.

Tire Analysis View

The Tire Analysis view focuses on tire performance and degradation throughout the race. It uses a tabbed interface to organize different analyses:

  1. Degradation Rate Analysis: Shows how quickly tire performance degrades over time
  2. Fuel-Adjusted Analysis: Compares raw vs. fuel-adjusted tire degradation
  3. Speed Comparison: Analyzes how sector speeds evolve as tires age The view uses specialized visualization functions such as st_plot_degradation_rate(), st_plot_regular_vs_adjusted_degradation(), and st_plot_speed_vs_tire_age().

Gap Analysis View

The Gap Analysis view examines the gaps between cars throughout the race. It includes:

  1. Gap Evolution: Shows how gaps to cars ahead and behind evolved during the race
  2. Undercut Opportunities: Visualizes windows where undercut or overcut strategies were possible
  3. Gap Consistency: Displays how consistently gaps were maintained over multiple laps
  4. Strategic Insights: Summarizes strategic opportunities identified from gap analysis This view helps race engineers identify strategic opportunities based on car position.

Lap Time Predictions View

This view displays predictions for future lap times based on machine learning models, helping teams anticipate performance changes. It provides:

  • Visualization of predicted lap times
  • Comparison between actual and predicted performance
  • Fuel-adjusted lap time analysis The predictions are generated using XGBoost models trained on historical race data.

Team Radio Analysis View

This view analyzes team radio communications for strategic insights, including:

  • Radio-based strategic recommendations
  • Radio message sentiment analysis
  • Key communications that might impact race strategy The system identifies radio messages that could indicate important events (weather changes, strategic decisions by competitors, etc.).

Strategy Recommendations View

This central view displays AI-generated strategy recommendations from the expert system. Engineers can review and filter recommendations based on:

  • Confidence levels
  • Action types
  • Strategic urgency

Strategy Chat Interface

A unique feature allowing engineers to ask natural language questions about race strategy. This LLM-powered interface:

  • Provides conversational access to strategy insights
  • Explains reasoning behind recommendations
  • Allows exploration of alternative strategies

Data Visualization

The dashboard heavily uses interactive visualizations to present complex race data in an intuitive format. These visualizations are implemented using Plotly and are rendered through specialized functions in the visualization.py file.

Key Visualization Functions

Function Purpose Source
st_plot_degradation_rate() Visualizes tire degradation rates visualization.py227-257
st_plot_regular_vs_adjusted_degradation() Compares raw vs. fuel-adjusted degradation visualization.py76-158
st_plot_gap_evolution() Shows gap evolution over time visualization.py260-310
st_plot_undercut_opportunities() Highlights strategic windows visualization.py313-362
st_plot_gap_consistency() Visualizes gap consistency metrics visualization.py365-399
st_plot_fuel_adjusted_degradation() Shows fuel-adjusted degradation data visualization.py161-191
Each visualization function takes processed data and creates interactive Plotly charts that engineers can explore within the dashboard.

Integration with Other Subsystems

The dashboard integrates with multiple subsystems to provide a comprehensive strategy management platform:

Performance Considerations

The dashboard implements several performance optimizations:

  1. Session State Caching: Data is loaded once and cached in session state to avoid redundant processing
  2. Selective Data Loading: Only data for the selected driver is processed when possible
  3. Error Handling: Robust error handling prevents dashboard crashes when data is missing or models fail

Key Files and Functions

The dashboard is implemented across several key files: | File | Purpose |


Documentation

Purpose and Scope

The F1 Strategy Manager combines telemetry data analysis, computer vision, natural language processing, and rule-based expert systems to:

  1. Analyze real-time race data from multiple sources

Key Components

Data Sources and Processing

The system ingests and processes data from three primary sources:

  1. Race Telemetry (FastF1): Lap times, sector data, tire information
  2. Team Radio (OpenF1): Audio transcripts from driver-team communications
  3. Video Footage: Raw race footage for gap calculation and position tracking Data processing is managed through the utils/processing.py module, which contains functions for transforming raw data into analysis-ready formats: | Function | Purpose | Source File | | --------------------------------- | ----------------------------------------------------------------------- | ------------- | | get_processed_race_data() | Transforms race telemetry with fuel adjustments and degradation metrics | processing.py | | get_processed_gap_data() | Calculates gap consistency between cars | processing.py |

Streamlit Interface

The user interface is built with Streamlit and provides multiple specialized views:

  1. Strategy Recommendations View: Displays AI-powered recommendations
  2. Gap Analysis View: Visualizes gaps between cars and identifies strategic opportunities
  3. Radio Analysis View: Shows insights from team radio communications
  4. Time Predictions View: Displays lap time predictions
  5. Tire Degradation View: Analyzes tire wear patterns and performance impacts The UI components are organized in the components directory, with each view implemented as a separate module.

Data Flow

The following diagram illustrates how data flows through the system from input sources to the user interface:

Key steps in the data flow:

  1. Data Acquisition: Raw data is collected from multiple sources
  2. Processing: The processing.py module transforms raw data into standardized formats
  3. Analysis: Machine learning models generate predictions and insights
  4. Rule Evaluation: The expert system applies rules to generate recommendations
  5. Visualization: The UI components render the processed data and recommendations

Documentation

Purpose and Scope

The NLP pipeline processes Formula 1 team radio messages to extract:

  • Overall sentiment (positive, negative, neutral)
  • Communication intent (orders, information, questions, etc.)
  • Specific racing entities (actions, incidents, track conditions, etc.)

Radio Transcription Component

The transcription component converts team radio audio files to text using OpenAI's Whisper model.

Architecture and Implementation

The transcription component uses Whisper Turbo, a speech-to-text model that balances accuracy and performance. Key implementation details include:

  • Model Size: Turbo variant (809M parameters) optimized for speed
  • Memory Usage: ~6GB VRAM, using FP16 precision to reduce memory requirements
  • Audio Processing: Handles multiple audio formats (MP3, WAV, M4A, OGG)
  • Batch Processing: Can transcribe multiple files and maintain driver metadata Example transcription:
"Max, we've currently got yellows in turn 7. Ferrari in the wall, no? Yes, that's Charles stopped. 
We are expecting the potential of an aborted start, but just keep to your protocol at the moment."

Sentiment Analysis Component

The sentiment analysis component classifies the emotional tone of radio messages into three categories: positive, negative, or neutral.

Model Architecture

The sentiment analyzer uses a fine-tuned RoBERTa-base model trained on labeled F1 radio messages. Key details:

  • Base Model: RoBERTa with 125M parameters
  • Fine-tuning: Trained on ~500 labeled team radio messages
  • Output: 3-class classification with confidence score
  • Integration: Deployed within predict_sentiment() function Example output:
{
  "text": "Great move Oscar",
  "sentiment": "positive",
  "confidence": 59.62
}

Intent Classification Component

The intent classification component identifies the communicative purpose of radio messages, categorizing them into functional types.

Intent Categories

Intent Description Example
ORDER Direct instructions requiring action "Box this lap", "Push now"
INFORMATION Factual updates about race conditions "Hamilton is 2 seconds behind"
PROBLEM Driver-reported issues "Losing grip on the rear"
WARNING Alerts about potential issues "Yellow flag in sector 2"
QUESTION Queries requiring driver input "How are the tyres feeling?"

Model Architecture

The intent classifier uses a fine-tuned RoBERTa-large model with:

  • Base Model: RoBERTa Large (355M parameters)
  • Fine-tuning: Trained on manually labeled intent data
  • Function: predict_intent() provides intent classification with confidence scores

Named Entity Recognition Component

The Named Entity Recognition (NER) component extracts specific racing-related entities from radio messages, providing structured information about actions, situations, incidents, and more.

Entity Types

The NER component processes text by:

  1. Tokenizing the input text
  2. Applying BERT-based token classification
  3. Converting token predictions to entity spans
  4. Formatting entities as a structured list Each entity is tagged with its type and the extracted text, enabling strategic analysis of specific racing elements.

BIO Tagging Approach

The NER model uses BIO (Beginning-Inside-Outside) tagging to identify multi-word entities:

  • B- tags mark the first word of an entity (e.g., B-ACTION)
  • I- tags mark words continuing an entity (e.g., I-ACTION)
  • O tags mark words not part of any entity Example BIO tagging:
"Max,"            -> O
"we've"           -> B-SITUATION
"currently"       -> I-SITUATION
"got"             -> I-SITUATION
"yellows"         -> I-SITUATION
"in"              -> I-SITUATION
"turn"            -> I-SITUATION
"7."              -> I-SITUATION
"Ferrari"         -> B-INCIDENT
"in"              -> I-INCIDENT
"the"             -> I-INCIDENT
"wall,"           -> I-INCIDENT

Pipeline Integration

The pipeline components are integrated into a unified analysis system that can process either audio or text input and produce standardized JSON output.

Integrated Pipeline Architecture

The integrated pipeline:

  1. Loads all three models (sentiment, intent, NER)
  2. Processes input through each model in parallel
  3. Combines predictions into a standardized format
  4. Outputs structured JSON with timestamp

Standardized JSON Output

The pipeline produces a JSON structure that captures all aspects of radio message analysis:

This structured output is stored with timestamps and can be directly consumed by the F1 Strategy Engine to inform race decisions.


Documentation

Model Architecture and Data Flow

The machine learning subsystem follows a multi-stage pipeline pattern, where raw data is processed through feature engineering steps before being fed into specialized models. The outputs are then standardized for consumption by the expert system.

Lap Time Prediction Model

The lap time prediction component uses XGBoost to forecast lap times with high accuracy (MAE = 0.09s and RMSE = 0.15s). It takes into account multiple factors that influence lap performance including tire compound, tire age, fuel load, and track conditions.

Model Features and Implementation

The XGBoost model processes a rich set of features derived from race telemetry:

Feature Category Examples Notes
Driver/Team DriverNumber, TeamID Captures team-specific performance
Tire CompoundID, TyreAge Critical for performance understanding
Speed SpeedI1, SpeedI2, SpeedFL, SpeedST Speed at different track sectors
Sequential Prev_LapTime, LapTime_Delta, LapTime_Trend Captures performance trends
Race Context Position, FuelLoad, DRSUsed Situational race factors
The model handles sequential data by creating derived features that track changes between laps and performance trends:

Usage and Integration

The lap time prediction model is exposed through a central predict_lap_times() function that handles the entire pipeline:

  1. Loading the trained model
  2. Validating input telemetry data
  3. Engineering sequential features
  4. Making predictions
  5. Formatting results for downstream use The function serves as the main interface between raw telemetry data and the expert system, providing both historical lap time analysis and future lap time forecasts.

Tire Degradation Model

The tire degradation component uses Temporal Convolutional Networks (TCN) to model how tire performance decreases over time. The model captures the non-linear nature of tire degradation for different compounds.

Degradation Metrics and Analysis

The system calculates several key degradation metrics from raw lap time data:

Metric Description Usage
TireDegAbsolute Raw lap time increase from baseline Direct performance loss
TireDegPercent Percentage lap time increase Relative performance change
FuelAdjustedDegAbsolute Degradation with fuel effect removed Isolates tire effects
DegradationRate Lap-to-lap change in performance Rate of performance loss
These metrics are calculated using functions like calculate_fuel_adjusted_metrics() and calculate_degradation_rate().

TCN Architecture and Implementation

The Temporal Convolutional Network is specifically designed to handle sequence modeling problems. For tire degradation, it:

  1. Takes a window of previous lap performance data (typically 5 laps)
  2. Processes through convolutional layers with dilated filters
  3. Outputs predictions for future degradation (next 3-5 laps) This approach captures how tire performance evolves over time, allowing for more accurate pit stop planning.

Vision-based Gap Calculation

The YOLOv8 computer vision model is used to identify teams from race footage, enabling gap calculation when telemetry data is unavailable or needs confirmation.

Performance and Accuracy Metrics

The machine learning models are evaluated on various metrics to ensure reliable strategy recommendations:

Model Key Metrics Performance
XGBoost Lap Time Prediction MAE, RMSE MAE = 0.09s, RMSE = 0.15s
TCN Tire Degradation Degradation Rate Accuracy Within ±0.05s/lap
YOLOv8 Team Detection mAP50 >90%
These metrics guide ongoing model improvements and help users understand the confidence level of strategy recommendations.

Future Model Enhancements

The machine learning subsystem is designed for extensibility, with plans for:


Documentation

Degradation Rules System

Evaluates tire performance and degradation patterns to recommend pit stops or stint extensions. Key rules include:

  • high_degradation_pit_stop: Triggers when degradation rates exceed safe thresholds
  • stint_extension_recommendation: Suggests extending stint when tires perform better than expected
  • early_degradation_warning: Provides early warnings for preparing pit stops

Lap Time Rules System

Analyzes current and predicted lap times to identify performance patterns. Key rules include:

  • optimal_performance_window: Identifies periods of peak performance for push strategies
  • performance_cliff_detection: Detects sudden performance drops requiring immediate action
  • post_traffic_recovery: Suggests recovery strategies after being in traffic

Radio Analysis Rules System

Interprets team radio messages using NLP for strategic insights. Key rules include:

  • grip_issue_response: Responds to driver reports of grip problems
  • weather_information_adjustment: Adjusts strategy based on weather reports
  • incident_reaction: Adapts to incidents reported on track

Gap Analysis Rules System

Examines the gaps between cars to identify strategic opportunities. Key rules include:

Integrated Strategy Engine

The F1CompleteStrategyEngine class inherits from all specialized rule systems, creating a comprehensive strategy engine that can apply rules from any domain. This integrated approach allows for holistic race strategy evaluation.

The integrated engine also tracks which specialized systems are active during each analysis:

This tracking helps with conflict resolution and understanding which aspects of the strategy are most influential.

Conflict Resolution

A key feature of the F1CompleteStrategyEngine is its ability to resolve conflicting recommendations. When multiple rules fire and suggest contradictory actions, the conflict resolution system determines the optimal strategy.

The conflict resolution follows these steps:

  1. Group recommendations by driver number
  2. For each driver's recommendations:
    • Identify conflicting action pairs (e.g., can't both extend stint and pit)
    • For each conflict, compare priority and confidence values
    • Select the recommendation with higher priority/confidence
    • Enhance the explanation of selected recommendations This approach ensures that drivers receive consistent, logical strategy advice even when multiple rules are triggered.

Data Transformation

Before rules can be applied, raw data must be transformed into fact objects. The transform_all_facts() function converts various data sources into fact instances:

  1. Tire prediction data: Converted to DegradationFact and TelemetryFact
  2. Lap time prediction data: Primarily affects TelemetryFact
  3. Gap data: Transformed into GapFact with consistency metrics
  4. Radio analysis: Converted to RadioFact

Documentation

High-Level Architecture

Directory Structure

Development Environment Setup

Prerequisites

  • Python 3.10+
  • CUDA-compatible GPU (optional, for model training)
  • Git

Setting Up the Development Environment

  1. Clone the repository:
  1. Create and activate a virtual environment:
  1. Install dependencies:
  1. Create necessary output directories (if not present):

Core Components

Main Application Structure

The application entry point is app.py, which handles navigation between different views and manages session state:

Key sections in the code:

Data Processing Pipeline

The processing.py module contains the core data transformation functions:

Key functions:

  • get_processed_race_data(): Processes raw telemetry with fuel adjustment and degradation metrics
  • get_processed_gap_data(): Processes gap data and calculates consistency metrics
  • get_lap_time_predictions(): Runs the lap time prediction model
  • calculate_gap_consistency(): Identifies consistent gap patterns for strategic opportunities

Visualization Utilities

The visualization.py module provides plotting functions for different data aspects:

Function Name Description Usage Example
st_plot_degradation_rate() Creates tire degradation rate visualization Used in degradation_view.py
st_plot_regular_vs_adjusted_degradation() Compares raw and fuel-adjusted degradation Used in degradation_view.py
st_plot_speed_vs_tire_age() Shows speed changes over tire life Used in degradation_view.py
st_plot_gap_evolution() Displays gap changes over laps Used in gap_analysis_view.py
st_plot_undercut_opportunities() Visualizes strategic opportunities Used in gap_analysis_view.py
st_plot_gap_consistency() Shows consistency of gaps over time Used in gap_analysis_view.py

Component Structure Pattern

UI components follow a consistent structure illustrated by the degradation_view component:

Extending the System

Adding a New UI Component

To add a new UI component:

  1. Create a new file in scripts/app/components/:
  1. Add the new component to app.py:

Adding a New Visualization Function

To add a new visualization function to visualization.py:

Integration with Processing Pipeline

To add a new data processing function:

Then integrate into the main processing pipeline:

API Reference

Data Processing API

get_processed_race_data(driver_number=None)

Loads and processes race data, applying fuel adjustment and degradation metrics. Parameters:

  • driver_number (int, optional): Filter for a specific driver Returns:
  • DataFrame with processed race data Usage:

get_processed_gap_data(driver_number=None)

Processes gap data with consistency metrics. Parameters:

  • driver_number (int, optional): Filter for a specific driver Returns:
  • DataFrame with processed gap data Usage:

get_lap_time_predictions(race_data, model_path=None, include_next_lap=True)

Runs the lap time prediction model. Parameters:

  • race_data (DataFrame): Processed race data
  • model_path (str, optional): Path to the model file
  • include_next_lap (bool): Whether to include next lap predictions Returns:
  • DataFrame with lap time predictions Usage:

Visualization API

st_plot_degradation_rate(processed_race_data, driver_number=None)

Creates a plot of tire degradation rate. Parameters:

  • processed_race_data (DataFrame): Processed race data
  • driver_number (int, optional): Driver number to filter for Returns:
  • Plotly figure object Usage:

st_plot_gap_evolution(gap_data, driver_number=None)

Creates a plot of gap evolution over laps. Parameters:

  • gap_data (DataFrame): Gap data
  • driver_number (int, optional): Driver number to filter for Returns:
  • Plotly figure object Usage:

Integration Guide

Data Flow Architecture

The system follows this data flow pattern:

Adding New ML Models

To integrate a new machine learning model:

  1. Add your model code in an appropriate directory
  2. Create a prediction function that loads and uses your model:
  1. Add a processing function to prepare data for your model
  2. Create visualization functions for your model's outputs

Integration Patterns and Best Practices

When integrating new components, follow these patterns:

  1. Error Handling: Use try-except blocks for all external calls and data processing
  2. Data Validation: Always check if data exists and has the right format
  3. Modular Design: Keep processing, visualization, and UI components separate
    Processing Module (process_data) → 
    Visualization Module (create_visualization) → 
    UI Component (render_component)
    
  4. Consistent Naming: Follow the established naming patterns
    • Processing functions: get_*, calculate_*, process_*
    • Visualization functions: st_plot_*
    • UI component functions: render_*_view

Troubleshooting

Common Issues

  1. Missing Data or Model Files
    • Check that required files exist in the expected locations:
      • Model files in outputs/week3/ and outputs/week5/models/
      • Data files in outputs/week6/
    • Use try-except blocks when loading files and provide helpful error messages
  2. Import Errors
    • Ensure Python modules are properly installed via requirements.txt
    • Check the import paths in the code, especially for local modules
    • Use the fallback pattern for imports as shown in scripts/app/utils/processing.py32-41
  3. Visualization Errors
    • Check that input DataFrames contain the expected columns
    • Handle edge cases like empty DataFrames or missing values
    • Add input validation before creating visualizations

Performance Optimization

  1. Data Filtering: Filter data early in the processing pipeline
  2. Caching: Use Streamlit's caching for expensive operations
  3. Error Handling with Fallbacks: Provide alternatives when primary data is unavailable

/private-repo

Private Repository Access - Devin powered by Devin

Sign up forDevinto access private repos

You need to sign up for Devin to access and index private repositories.

  • Wiki and search for all your Github repos
  • $20 minimum to get started on the Core Plan
  • Build more with Devin, the AI software engineering agent Sign up

⚠️ **GitHub.com Fallback** ⚠️