Spaces:
Sleeping
Sleeping
Nikita Makarov
commited on
Commit
·
65a1cdf
1
Parent(s):
2fe88e9
v3
Browse files- DEPLOY_HF.md +0 -79
- README.md +27 -32
- README_HF_SPACES.md +0 -56
- SECRETS_SETUP.md +0 -57
DEPLOY_HF.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
| 1 |
-
# Deploying to HuggingFace Spaces
|
| 2 |
-
|
| 3 |
-
## Step-by-Step Guide
|
| 4 |
-
|
| 5 |
-
### 1. Create a New Space
|
| 6 |
-
|
| 7 |
-
1. Go to [HuggingFace Spaces](https://huggingface.co/spaces)
|
| 8 |
-
2. Click "Create new Space"
|
| 9 |
-
3. Fill in:
|
| 10 |
-
- **Space name**: `ai-radio` (or your preferred name)
|
| 11 |
-
- **SDK**: Select **Gradio**
|
| 12 |
-
- **Hardware**: CPU (or GPU if available)
|
| 13 |
-
- **Visibility**: Public or Private
|
| 14 |
-
|
| 15 |
-
### 2. Configure Secrets
|
| 16 |
-
|
| 17 |
-
After creating the Space, go to **Settings → Secrets** and add:
|
| 18 |
-
|
| 19 |
-
| Secret Name | Value | Required |
|
| 20 |
-
|------------|-------|----------|
|
| 21 |
-
| `ELEVENLABS_API_KEY` | Your ElevenLabs API key | ✅ Yes |
|
| 22 |
-
| `NEBIUS_API_KEY` | Your Nebius API key | ✅ Yes |
|
| 23 |
-
| `LLAMAINDEX_API_KEY` | Your LlamaIndex API key | ⚠️ Optional |
|
| 24 |
-
| `OPENAI_API_KEY` | Your OpenAI API key (for embeddings fallback) | ⚠️ Optional |
|
| 25 |
-
|
| 26 |
-
### 3. Push Your Code
|
| 27 |
-
|
| 28 |
-
You can either:
|
| 29 |
-
|
| 30 |
-
**Option A: Git Push**
|
| 31 |
-
```bash
|
| 32 |
-
git remote add hf https://huggingface.co/spaces/<your-username>/<space-name>
|
| 33 |
-
git push hf main
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
**Option B: Upload via Web UI**
|
| 37 |
-
- Go to your Space page
|
| 38 |
-
- Click "Files and versions"
|
| 39 |
-
- Upload all files from your local `ai_radio` directory
|
| 40 |
-
|
| 41 |
-
### 4. Required Files
|
| 42 |
-
|
| 43 |
-
Make sure these files are in your Space repository:
|
| 44 |
-
|
| 45 |
-
- ✅ `app.py` - Entry point (already created)
|
| 46 |
-
- ✅ `requirements.txt` - Dependencies
|
| 47 |
-
- ✅ `README.md` - Space description
|
| 48 |
-
- ✅ `src/` - Source code directory
|
| 49 |
-
- ✅ `.gitignore` - Git ignore rules
|
| 50 |
-
|
| 51 |
-
### 5. Verify Deployment
|
| 52 |
-
|
| 53 |
-
1. Check the **Logs** tab in your Space
|
| 54 |
-
2. Wait for the build to complete
|
| 55 |
-
3. The app should be available at: `https://huggingface.co/spaces/<your-username>/<space-name>`
|
| 56 |
-
|
| 57 |
-
## Troubleshooting
|
| 58 |
-
|
| 59 |
-
### Build Fails
|
| 60 |
-
- Check that `requirements.txt` has all dependencies
|
| 61 |
-
- Verify Python version compatibility (3.9+)
|
| 62 |
-
- Check logs for specific error messages
|
| 63 |
-
|
| 64 |
-
### App Doesn't Start
|
| 65 |
-
- Verify all required secrets are set
|
| 66 |
-
- Check that `app.py` is at the root level
|
| 67 |
-
- Ensure port is set to 7860 (HF Spaces default)
|
| 68 |
-
|
| 69 |
-
### API Errors
|
| 70 |
-
- Double-check that API keys are correctly set as secrets
|
| 71 |
-
- Verify API keys are valid and have sufficient credits/quota
|
| 72 |
-
|
| 73 |
-
## Notes
|
| 74 |
-
|
| 75 |
-
- The app uses port 7860 by default on HF Spaces (configured in `app.py`)
|
| 76 |
-
- Audio files are stored temporarily in `audio/` directory
|
| 77 |
-
- User data persists in `user_memory.json` and `user_data.json`
|
| 78 |
-
- Logs are available in the Space's Logs tab
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -1,27 +1,16 @@
|
|
| 1 |
-
---
|
| 2 |
title: AI Radio - Personalized Radio Station
|
| 3 |
emoji: 🎵
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.44.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
| 11 |
tags:
|
| 12 |
-
- mcp
|
| 13 |
- mcp-in-action-track-consumer
|
| 14 |
-
-
|
| 15 |
-
- ai
|
| 16 |
-
- radio
|
| 17 |
-
- music
|
| 18 |
-
- nebius
|
| 19 |
-
- gpt-oss-120b
|
| 20 |
-
- elevenlabs
|
| 21 |
-
- llamaindex
|
| 22 |
-
- rag
|
| 23 |
-
- autonomous-agent
|
| 24 |
-
---
|
| 25 |
|
| 26 |
# 🎵 AI Radio - Your Personal Radio Station
|
| 27 |
|
|
@@ -31,6 +20,28 @@ tags:
|
|
| 31 |
|
| 32 |
**AI Radio** is an intelligent, personalized radio station powered by cutting-edge AI technology. It creates a unique listening experience tailored to your preferences, mood, and interests. Built for the **MCP 1st Birthday Competition**, this app demonstrates autonomous agent behavior, MCP integration, and advanced RAG capabilities.
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
## 📁 Project Structure
|
| 35 |
|
| 36 |
```
|
|
@@ -86,7 +97,7 @@ ai_radio/
|
|
| 86 |
|
| 87 |
This app fulfills all requirements for **Track 2: MCP in Action**:
|
| 88 |
|
| 89 |
-
✅ **Autonomous Agent Behavior**: The
|
| 90 |
|
| 91 |
✅ **MCP Servers as Tools**: Implements three MCP servers:
|
| 92 |
- **MusicMCPServer**: Music search and playlist generation
|
|
@@ -100,15 +111,6 @@ This app fulfills all requirements for **Track 2: MCP in Action**:
|
|
| 100 |
- **Context Engineering**: Personalizes content based on user preferences and history
|
| 101 |
- **Streaming Capabilities**: Efficient audio generation and playback
|
| 102 |
|
| 103 |
-
## 🛠️ Technology Stack
|
| 104 |
-
|
| 105 |
-
- **Gradio**: Interactive web interface
|
| 106 |
-
- **Nebius GPT-OSS-120B** (OpenAI-compatible): LLM for content generation, host commentary, and reasoning
|
| 107 |
-
- **ElevenLabs**: High-quality text-to-speech for voice generation
|
| 108 |
-
- **LlamaIndex**: RAG system for personalized recommendations and user preference management
|
| 109 |
-
- **MCP (Model Context Protocol)**: Structured tool servers for modular functionality
|
| 110 |
-
- **Python**: Core application logic
|
| 111 |
-
- **RSS Feeds**: Real-time news aggregation
|
| 112 |
|
| 113 |
## 🚀 Getting Started
|
| 114 |
|
|
@@ -279,17 +281,10 @@ This is a hackathon submission, but contributions and feedback are welcome!
|
|
| 279 |
|
| 280 |
MIT License - feel free to use and modify as needed.
|
| 281 |
|
| 282 |
-
## 🙏 Acknowledgments
|
| 283 |
-
|
| 284 |
-
- **MCP Team** for the amazing protocol and competition
|
| 285 |
-
- **Nebius** for GPT-OSS-120B API
|
| 286 |
-
- **ElevenLabs** for text-to-speech technology
|
| 287 |
-
- **LlamaIndex** for RAG capabilities
|
| 288 |
-
- **Gradio** for the beautiful UI framework
|
| 289 |
-
|
| 290 |
## 📧 Contact
|
| 291 |
|
| 292 |
Built with ❤️ for the MCP 1st Birthday Competition
|
|
|
|
| 293 |
|
| 294 |
---
|
| 295 |
|
|
|
|
|
|
|
| 1 |
title: AI Radio - Personalized Radio Station
|
| 2 |
emoji: 🎵
|
| 3 |
colorFrom: purple
|
| 4 |
colorTo: pink
|
| 5 |
sdk: gradio
|
| 6 |
+
sdk_version: 4.44.1
|
| 7 |
app_file: app.py
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
+
short_description: Entertaining AI Radio with LLM as a Host
|
| 11 |
tags:
|
|
|
|
| 12 |
- mcp-in-action-track-consumer
|
| 13 |
+
- mcp-in-action-track-creative
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# 🎵 AI Radio - Your Personal Radio Station
|
| 16 |
|
|
|
|
| 20 |
|
| 21 |
**AI Radio** is an intelligent, personalized radio station powered by cutting-edge AI technology. It creates a unique listening experience tailored to your preferences, mood, and interests. Built for the **MCP 1st Birthday Competition**, this app demonstrates autonomous agent behavior, MCP integration, and advanced RAG capabilities.
|
| 22 |
|
| 23 |
+
## 🦾 Participants
|
| 24 |
+
https://huggingface.co/nikimakarov
|
| 25 |
+
|
| 26 |
+
## 🛠️ Technology Stack
|
| 27 |
+
|
| 28 |
+
- **Gradio**: Interactive web interface
|
| 29 |
+
- **OpenAI GPT-OSS-120B provided by Nebius** : LLM for content generation, host commentary, and reasoning
|
| 30 |
+
- **ElevenLabs**: High-quality text-to-speech for voice generation
|
| 31 |
+
- **LlamaIndex**: RAG system for personalized recommendations and user preference management
|
| 32 |
+
- **MCP (Model Context Protocol)**: Structured tool servers for modular functionality
|
| 33 |
+
- **Python**: Core application logic
|
| 34 |
+
- **RSS Feeds**: Real-time news aggregation
|
| 35 |
+
|
| 36 |
+
## 🙏 Acknowledgments
|
| 37 |
+
|
| 38 |
+
- **Gradio Team** for the beautiful UI framework
|
| 39 |
+
- **MCP Team** for the amazing protocol and competition
|
| 40 |
+
- **OpenAI** for creating GPT-OSS-120B
|
| 41 |
+
- **Nebius** for providing models API
|
| 42 |
+
- **ElevenLabs** for text-to-speech technology
|
| 43 |
+
- **LlamaIndex** for RAG capabilities
|
| 44 |
+
|
| 45 |
## 📁 Project Structure
|
| 46 |
|
| 47 |
```
|
|
|
|
| 97 |
|
| 98 |
This app fulfills all requirements for **Track 2: MCP in Action**:
|
| 99 |
|
| 100 |
+
✅ **Autonomous Agent Behavior**: The Radio Agent demonstrates planning (show planning), reasoning (segment selection based on preferences), and execution (content generation and delivery)
|
| 101 |
|
| 102 |
✅ **MCP Servers as Tools**: Implements three MCP servers:
|
| 103 |
- **MusicMCPServer**: Music search and playlist generation
|
|
|
|
| 111 |
- **Context Engineering**: Personalizes content based on user preferences and history
|
| 112 |
- **Streaming Capabilities**: Efficient audio generation and playback
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
## 🚀 Getting Started
|
| 116 |
|
|
|
|
| 281 |
|
| 282 |
MIT License - feel free to use and modify as needed.
|
| 283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
## 📧 Contact
|
| 285 |
|
| 286 |
Built with ❤️ for the MCP 1st Birthday Competition
|
| 287 |
+
Contact: @nikimakarov
|
| 288 |
|
| 289 |
---
|
| 290 |
|
README_HF_SPACES.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
| 1 |
-
# AI Radio - HuggingFace Spaces Deployment
|
| 2 |
-
|
| 3 |
-
This is the deployment guide for hosting AI Radio on HuggingFace Spaces.
|
| 4 |
-
|
| 5 |
-
## 🚀 Quick Start
|
| 6 |
-
|
| 7 |
-
1. **Create a new Space** on HuggingFace Spaces
|
| 8 |
-
- Choose "Gradio" as the SDK
|
| 9 |
-
- Set the hardware to "CPU" (or "GPU" if available)
|
| 10 |
-
|
| 11 |
-
2. **Configure Secrets** in your Space settings:
|
| 12 |
-
Go to **Settings → Secrets** and add the following:
|
| 13 |
-
|
| 14 |
-
**Required Secrets:**
|
| 15 |
-
- `ELEVENLABS_API_KEY` - Your ElevenLabs API key (for text-to-speech)
|
| 16 |
-
- `NEBIUS_API_KEY` - Your Nebius API key (for GPT-OSS-120B LLM)
|
| 17 |
-
|
| 18 |
-
**Optional Secrets:**
|
| 19 |
-
- `LLAMAINDEX_API_KEY` - Your LlamaIndex API key (for embeddings, fallback to local)
|
| 20 |
-
- `OPENAI_API_KEY` - OpenAI API key (for embeddings fallback, optional)
|
| 21 |
-
|
| 22 |
-
📖 **Detailed instructions:** See `SECRETS_SETUP.md` for step-by-step guide
|
| 23 |
-
|
| 24 |
-
3. **Push your code** to the Space repository
|
| 25 |
-
|
| 26 |
-
## 📁 File Structure
|
| 27 |
-
|
| 28 |
-
The Space expects:
|
| 29 |
-
- `app.py` - Entry point (already created)
|
| 30 |
-
- `requirements.txt` - Python dependencies (already exists)
|
| 31 |
-
- `src/` - Source code directory
|
| 32 |
-
- `README.md` - This file (will be displayed on Space)
|
| 33 |
-
|
| 34 |
-
## 🔧 Configuration
|
| 35 |
-
|
| 36 |
-
API keys are loaded from environment variables (set as Secrets in HF Spaces):
|
| 37 |
-
- `ELEVENLABS_API_KEY` - Required for text-to-speech
|
| 38 |
-
- `NEBIUS_API_KEY` - Required for LLM (GPT-OSS-120B)
|
| 39 |
-
- `LLAMAINDEX_API_KEY` - Optional, for LlamaIndex embeddings
|
| 40 |
-
- `OPENAI_API_KEY` - Optional, for OpenAI embeddings fallback
|
| 41 |
-
|
| 42 |
-
## 📝 Notes
|
| 43 |
-
|
| 44 |
-
- The app will run on port 7860 (HF Spaces default)
|
| 45 |
-
- Audio files are stored in `audio/` directory
|
| 46 |
-
- User data is stored in `user_memory.json` and `user_data.json`
|
| 47 |
-
- Logs are stored in `logs/` directory
|
| 48 |
-
|
| 49 |
-
## 🐛 Troubleshooting
|
| 50 |
-
|
| 51 |
-
If the app doesn't start:
|
| 52 |
-
1. Check that all required secrets are set
|
| 53 |
-
2. Check the logs in the Space
|
| 54 |
-
3. Ensure `requirements.txt` has all dependencies
|
| 55 |
-
4. Verify that `app.py` is at the root level
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SECRETS_SETUP.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
| 1 |
-
# 🔐 Настройка Secrets для HuggingFace Spaces
|
| 2 |
-
|
| 3 |
-
## Необходимые Secrets
|
| 4 |
-
|
| 5 |
-
Перейдите в **Settings → Secrets** вашего Space и добавьте следующие секреты:
|
| 6 |
-
|
| 7 |
-
### Обязательные Secrets:
|
| 8 |
-
|
| 9 |
-
1. **`ELEVENLABS_API_KEY`**
|
| 10 |
-
- Значение: Ваш API ключ от ElevenLabs
|
| 11 |
-
- Использование: Текст-в-речь (TTS)
|
| 12 |
-
- Где получить: https://elevenlabs.io/
|
| 13 |
-
|
| 14 |
-
2. **`NEBIUS_API_KEY`**
|
| 15 |
-
- Значение: Ваш API ключ от Nebius
|
| 16 |
-
- Использование: LLM (GPT-OSS-120B) для генерации контента
|
| 17 |
-
- Где получить: https://nebius.com/
|
| 18 |
-
|
| 19 |
-
### Опциональные Secrets:
|
| 20 |
-
|
| 21 |
-
3. **`LLAMAINDEX_API_KEY`**
|
| 22 |
-
- Значение: Ваш API ключ от LlamaIndex
|
| 23 |
-
- Использование: Embeddings для RAG системы (если не используется локальный)
|
| 24 |
-
- Где получить: https://llamaindex.ai/
|
| 25 |
-
- Примечание: Если не указан, используется локальный sentence-transformers
|
| 26 |
-
|
| 27 |
-
4. **`OPENAI_API_KEY`**
|
| 28 |
-
- Значение: Ваш API ключ от OpenAI
|
| 29 |
-
- Использование: Fallback для embeddings (если LlamaIndex недоступен)
|
| 30 |
-
- Где получить: https://platform.openai.com/
|
| 31 |
-
- Примечание: Опционально, используется только как fallback
|
| 32 |
-
|
| 33 |
-
## Как добавить Secrets в HF Spaces:
|
| 34 |
-
|
| 35 |
-
1. Откройте ваш Space: https://huggingface.co/spaces/MCP-1st-Birthday/AI-RADIO
|
| 36 |
-
2. Перейдите в **Settings** (вкладка справа)
|
| 37 |
-
3. Прокрутите до раздела **Secrets**
|
| 38 |
-
4. Нажмите **"New secret"**
|
| 39 |
-
5. Введите имя секрета (например, `ELEVENLABS_API_KEY`)
|
| 40 |
-
6. Введите значение секрета
|
| 41 |
-
7. Нажмите **"Add secret"**
|
| 42 |
-
8. Повторите для всех необходимых секретов
|
| 43 |
-
|
| 44 |
-
## Проверка:
|
| 45 |
-
|
| 46 |
-
После добавления всех секретов:
|
| 47 |
-
1. Перейдите во вкладку **Logs**
|
| 48 |
-
2. Дождитесь перезапуска Space
|
| 49 |
-
3. Проверьте логи на наличие предупреждений о недостающих ключах
|
| 50 |
-
|
| 51 |
-
## Важно:
|
| 52 |
-
|
| 53 |
-
- ✅ Все API ключи теперь читаются ТОЛЬКО из переменных окружения
|
| 54 |
-
- ✅ Никакие ключи не хранятся в коде
|
| 55 |
-
- ✅ Код безопасен для публичного репозитория
|
| 56 |
-
- ⚠️ Убедитесь, что все необходимые секреты добавлены перед запуском
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|