Skip to content

zerdalu/factory

Repository files navigation

Cerebras Smart Factory: Real-Time Multi-Agent Simulation

Built for the Cerebras x Google DeepMind Gemma 4 Hackathon Target Tracks: Track 1 (Multiverse Agents) & Track 3 (Enterprise Impact)

🚀 The Pitch

Real-time multi-agent simulations have traditionally been impossible due to LLM latency. We built a dynamic manufacturing simulation where 5 AI Manager Agents autonomously control 50+ worker units in real-time.

Powered by the lightning-fast inference of Cerebras and the multimodal capabilities of Gemma 4 31B, the AI managers converse, adapt to emergencies, parse visual quality control data, and output structured JSON commands in milliseconds without freezing the factory floor.

🧠 AI Architecture (The "Brain vs. Brawn" Model)

To maximize the 100 RPM limit while maintaining a massive sense of scale, we separated the AI brains from the worker bodies:

  • Planner: This agent will check the orders placed by user. Then give commands to other agents to successfully manufacture a product.
  • Inventory Workers: They receive commands from Planner and carry parts needed for the manufacture of the ordered product to Assembly Line.
  • Assembly Workers: They manufacture the ordered product. They use the parts coming from Inventory, if parts didn't come in time, they wait. These workers also responsible for the layout of Assembly Line. If needed they may shorten or lengthen conveyor belt and carry additional pallets to Assembly Line from Pallet Keeping Area. Planner chooses which product to be manufactured by the state of factory and these workers arrange Assembly Line accordingly.
  • Warehous Workers: They carry the manufactured products from Staging Area to Warehouse.

⚡ Highlighting Cerebras Speed

  • Instant Agent Chatter: Speech bubbles above the Manager agents update in milliseconds, creating a highly responsive, chaotic, and living factory floor.
  • No UI Blocking: Because Cerebras inference is so fast, the 50 worker nodes continue moving seamlessly across the screen at 60 FPS while the managers think.

🛠 Tech Stack

  • Frontend/Backend: TanStack Start (React + SSR)
  • Visuals: HTML Canvas API (Drawing colored circles, shapes, and dynamic speech bubbles)
  • AI Provider: Cerebras Inference API (OpenAI SDK compatible)
  • Model: gemma-4-31b (Text & Vision)

💻 Running Locally

  1. Clone the repository:

    git clone [your-repo-link]
    cd [your-repo-folder]
  2. Install dependencies:

    npm install
    # or yarn / pnpm install
  3. Set up Environment Variables: Create a .env file in the root directory and add your Cerebras API key:

    CEREBRAS_API_KEY=your_api_key_here
  4. Run the Development Server:

    npm run dev
  5. View the Factory: Open http://localhost:3000 in your browser. Enter a command in the input box to start the simulation!


🎥 Demo Video

[Insert Link to your X/Twitter or YouTube 60-second video here]

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors