robertkeus's picture
Upload app.py with huggingface_hub
c01276e verified
"""Hugging Face Spaces entry point for Reachy Mini Conversation App.
This Space serves as documentation and installation hub for the Reachy Mini
Conversation App - a voice-activated coding assistant for the Reachy Mini robot.
"""
import gradio as gr
DESCRIPTION = """
# ๐ŸŽจ Reachy the Vibe Coder
**Voice-activated coding with Reachy Mini!** Tell Reachy what to build, and watch it come to life in Cursor IDE.
> "Reachy, build me a website" โ†’ Reachy decides the colors, layout, animations, everything, and codes it for you!
## ๐Ÿš€ Quick Install
```bash
pip install git+https://huggingface.co/spaces/robertkeus/reachy-vibe-coder
```
## ๐Ÿ“‹ Requirements
- Python 3.10+
- [Reachy Mini SDK](https://github.com/pollen-robotics/reachy_mini/) installed
- OpenAI API key (for realtime conversation)
- Reachy Mini robot (hardware or simulator)
## ๐ŸŽฎ Running the App
```bash
# Activate your environment
source .venv/bin/activate
# Run with Gradio UI
reachy-vibe-coder --gradio
# Run with face tracking
reachy-vibe-coder --head-tracker mediapipe
# Audio only (no camera)
reachy-vibe-coder --no-camera
```
## โœจ Features
| Tool | Description |
|------|-------------|
| `vibe_code` | ๐ŸŽจ Tell Reachy to build something - it decides ALL the details! |
| `vibe_big_project` | ๐Ÿš€ For epic builds using Cursor's Agent mode |
| `dance` | ๐Ÿ’ƒ Queue choreographed dances |
| `play_emotion` | ๐Ÿ˜Š Play recorded emotion clips |
| `camera` | ๐Ÿ“ท Capture and analyze camera frames |
| `head_tracking` | ๐Ÿ‘€ Enable/disable face tracking |
## ๐Ÿ—๏ธ Architecture
The app combines:
- **OpenAI Realtime API** for voice conversation
- **FastRTC** for low-latency audio streaming
- **Gradio** for the web interface
- **Reachy Mini SDK** for robot control
- **Cursor IDE integration** for vibe coding
---
*This Space provides installation and documentation. The actual app runs locally with your Reachy Mini robot.*
"""
INSTALL_INSTRUCTIONS = """
## ๐Ÿ“ฆ Installation Methods
### Using uv (recommended)
```bash
git clone https://huggingface.co/spaces/robertkeus/reachy-vibe-coder
cd reachy-vibe-coder
uv venv --python 3.12.1
source .venv/bin/activate
uv sync
```
### Using pip
```bash
git clone https://huggingface.co/spaces/robertkeus/reachy-vibe-coder
cd reachy-vibe-coder
python -m venv .venv
source .venv/bin/activate
pip install -e .
```
### Optional Dependencies
```bash
# Wireless Reachy Mini support
pip install -e .[reachy_mini_wireless]
# Vision options
pip install -e .[local_vision] # PyTorch/Transformers
pip install -e .[yolo_vision] # YOLO tracking
pip install -e .[mediapipe_vision] # MediaPipe
pip install -e .[all_vision] # Everything
```
## โš™๏ธ Configuration
1. Copy `.env.example` to `.env`
2. Add your OpenAI API key:
```env
OPENAI_API_KEY=your-key-here
```
## ๐Ÿ”ง Troubleshooting
**Timeout error?**
Make sure the Reachy Mini daemon is running:
```bash
# Install and start the SDK first
# See: https://github.com/pollen-robotics/reachy_mini/
```
"""
def create_demo():
"""Create the Gradio demo interface."""
with gr.Blocks(
title="Reachy the Vibe Coder",
theme=gr.themes.Soft(
primary_hue="blue",
secondary_hue="purple",
),
css="""
.main-header {
background: linear-gradient(135deg, #00d4aa 0%, #7c3aed 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.install-box {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
border-radius: 12px;
padding: 20px;
}
footer {
visibility: hidden;
}
"""
) as demo:
gr.Markdown(DESCRIPTION)
with gr.Accordion("๐Ÿ“ฆ Detailed Installation Guide", open=False):
gr.Markdown(INSTALL_INSTRUCTIONS)
with gr.Accordion("๐ŸŽฌ Demo Video", open=False):
gr.Markdown("""
*Coming soon: Video demonstration of Reachy the Vibe Coder in action!*
![Reachy Mini Dance](https://raw.githubusercontent.com/pollen-robotics/reachy_mini/main/docs/assets/reachy_mini_dance.gif)
""")
with gr.Row():
gr.Markdown("""
### ๐Ÿ”— Links
- [Reachy Mini SDK](https://github.com/pollen-robotics/reachy_mini/)
- [Pollen Robotics](https://www.pollen-robotics.com/)
""")
gr.Markdown("""
### ๐Ÿ“„ License
Apache 2.0
Made with โค๏ธ by Robert Keus
""")
return demo
if __name__ == "__main__":
demo = create_demo()
demo.launch()