Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Laya Model AI Pong Agent

High-speed System 1 decision engine executing real-time reflex control in under 35 milliseconds.

License: Apache 2.0 Python 3.10+ Model: Laya 421M Latency: 32.8ms


🎯 Quick Overview

Laya Model AI Pong Agent is a real-time AI game opponent powered by ConvAI Innovations' open-weight Laya decision model. Unlike traditional text-generating LLMs that take hundreds of milliseconds to stream words, Laya answers structured questions directly in a single 32.8 ms forward pass on commodity hardware.

🔄 3-Step Workflow

Step 1: State Input Step 2: Laya Reflex Pass Step 3: Paddle Action
📍 Canvas coordinates & ball velocity ⚡ 32.8ms direct choice evaluation 🏓 Instant move execution (UP/DOWN)

💻 1-Liner Installation & Launch

Install dependencies and start the real-time game server with copy-pastable commands:

pip install laya fastapi uvicorn requests jinja2
python main.py

Open your browser to http://127.0.0.1:8000 to play against the AI agent.


🛠️ Architecture & Tech Stack

Laya AI Pong Agent/
├── game.html       # Standalone HTML5 Canvas frontend & telemetry UI
├── main.py         # FastAPI backend server & Laya model interface
└── README.md       # Project documentation & execution guide
  • Core AI Engine: laya (ModernBERT-large 421M backbone)
  • Backend Web Server: FastAPI + Uvicorn
  • Frontend Visualizer: HTML5 Canvas (60 FPS rendering) + CSS3 Glassmorphic UI

📊 Performance Benchmarks

Metric TypeSafe Jev (Proprietary) Laya Model (This Agent) Advantage
Single Move Latency 236.0 ms 32.8 ms 7.8× Faster
Probability Calibration 0.246 ECE 0.081 ECE 3× Better
Language Support English Only 100+ Languages Global Coverage
API Cost $0.042 / 1M Tokens $0.00 (Self-Hosted) 100% Free

🌐 5 Practical Use Cases

  1. ⚡ High-Speed Game Physics AI: Controlling NPCs and opponents requiring sub-50ms reaction times.
  2. 🛡️ Real-Time LLM Guardrails: Inspecting incoming user prompts for jailbreaks in under 35 milliseconds.
  3. 📬 Automated Ticket Triage: Categorizing customer support issues instantly into correct engineering queues.
  4. ** Phishing Email Detection:** Classifying suspicious email headers and body copy with honest probabilities.
  5. 🔍 RAG Passage Filtering: Evaluating document chunk relevance in a single forward pass before generating answers.

🔮 5 Future Roadmap Features

  1. 🎮 Multi-Agent Doubles Pong: 2 v 2 player matches powered by distinct Laya sub-routines.
  2. 🚀 GPU Batched Processing: Running 50 simultaneous game sessions on a single graphics card.
  3. 📈 Dynamic Difficulty Scaling: Adjusting confidence temperature to scale paddle speed dynamically.
  4. 🧠 On-Policy Fine-Tuning Notebook: Fine-tuning custom decision models directly on recorded gameplay.
  5. 🌐 Multilingual Voice Commands: Controlling paddles with voice inputs across 100+ supported languages.

🏷️ Keywords & Tags

Laya AI Laya 0.4B System 1 AI Non-Autoregressive Model TypeSafe Jev Alternative 32ms Latency RLCD Reinforcement Learning FastAPI Pong AI Calibrated Decision Engine Open Source AI Apache 2.0

About

Laya 0.4B: The Free Jev Killer That Answers in 32ms! Sub-35ms open-weight System 1 decision model running real-time Pong AI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages