Spaces:
Sleeping
Sleeping
Delete README_SPACE.md
Browse files- README_SPACE.md +0 -164
README_SPACE.md
DELETED
|
@@ -1,164 +0,0 @@
|
|
| 1 |
-
# Multi-Agent Content Generation System - Hugging Face Space
|
| 2 |
-
|
| 3 |
-
This is a Hugging Face Space deployment of the multi-agent content generation system. The system orchestrates seven specialized AI agents to collaboratively produce high-quality written content.
|
| 4 |
-
|
| 5 |
-
## Features
|
| 6 |
-
|
| 7 |
-
- **7 Specialized Agents** - Showrunner, Story Editor, Cultural Consultant, Lead Writer, Dialogue Specialist, Comedy Writer, and Proofreader
|
| 8 |
-
- **API-First Architecture** - RESTful endpoints for all operations
|
| 9 |
-
- **OpenRouter Integration** - Powered by `poolside/laguna-m.1:free` model
|
| 10 |
-
- **Hugging Face Integration** - Automatic upload of outputs to dataset
|
| 11 |
-
- **Persistent Storage** - All agent outputs saved as JSON
|
| 12 |
-
|
| 13 |
-
## Setup
|
| 14 |
-
|
| 15 |
-
### 1. Create the Space
|
| 16 |
-
|
| 17 |
-
Go to [Hugging Face Spaces](https://huggingface.co/spaces) and create a new Space:
|
| 18 |
-
- **Name:** `multi-agent-system` (or your preferred name)
|
| 19 |
-
- **License:** MIT (or your choice)
|
| 20 |
-
- **Space SDK:** Docker
|
| 21 |
-
- **Visibility:** Private (recommended for security)
|
| 22 |
-
|
| 23 |
-
### 2. Add Secrets
|
| 24 |
-
|
| 25 |
-
In your Space settings, add the following secrets:
|
| 26 |
-
|
| 27 |
-
#### `OPENROUTER_API_KEY`
|
| 28 |
-
Your OpenRouter API key for accessing the `poolside/laguna-m.1:free` model.
|
| 29 |
-
- Get it from: https://openrouter.ai/keys
|
| 30 |
-
|
| 31 |
-
#### `HUGGINGFACE_TOKEN`
|
| 32 |
-
Your Hugging Face user access token with write permissions.
|
| 33 |
-
- Get it from: https://huggingface.co/settings/tokens
|
| 34 |
-
- Must have write access to the `factorstudios/Pipeline` dataset
|
| 35 |
-
|
| 36 |
-
### 3. Configure Environment Variables
|
| 37 |
-
|
| 38 |
-
Optional environment variables (set in Space settings if needed):
|
| 39 |
-
|
| 40 |
-
- `HUGGINGFACE_DATASET` - Target dataset (default: `factorstudios/Pipeline`)
|
| 41 |
-
- `OPENROUTER_BASE_URL` - OpenRouter API endpoint (default: `https://openrouter.ai/api/v1`)
|
| 42 |
-
- `MODEL_NAME` - Model to use (default: `poolside/laguna-m.1:free`)
|
| 43 |
-
- `LOG_LEVEL` - Logging level (default: `INFO`)
|
| 44 |
-
|
| 45 |
-
## Usage
|
| 46 |
-
|
| 47 |
-
### Health Check
|
| 48 |
-
|
| 49 |
-
```bash
|
| 50 |
-
curl https://your-space-url/health
|
| 51 |
-
```
|
| 52 |
-
|
| 53 |
-
### Execute Full Pipeline
|
| 54 |
-
|
| 55 |
-
```bash
|
| 56 |
-
curl -X POST https://your-space-url/api/v1/pipeline/execute \
|
| 57 |
-
-H "Content-Type: application/json" \
|
| 58 |
-
-d '{
|
| 59 |
-
"user_brief": "A comedic episode about...",
|
| 60 |
-
"season_arc_document": "Season context...",
|
| 61 |
-
"character_bible": "Character definitions...",
|
| 62 |
-
"world_building_document": "World context...",
|
| 63 |
-
"character_voice_guide": "Voice definitions...",
|
| 64 |
-
"style_guide": "Style reference...",
|
| 65 |
-
"continuity_log": "Continuity tracking...",
|
| 66 |
-
"hook_brief": "Optional hook..."
|
| 67 |
-
}'
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
### API Documentation
|
| 71 |
-
|
| 72 |
-
Visit `https://your-space-url/docs` for interactive API documentation.
|
| 73 |
-
|
| 74 |
-
## API Endpoints
|
| 75 |
-
|
| 76 |
-
### Pipeline Management
|
| 77 |
-
- `GET /health` - Health check
|
| 78 |
-
- `POST /api/v1/pipeline/execute` - Execute full pipeline
|
| 79 |
-
- `GET /api/v1/pipeline/status/{run_id}` - Get pipeline status
|
| 80 |
-
|
| 81 |
-
### Individual Agents
|
| 82 |
-
- `POST /api/v1/showrunner/generate_directive` - Generate directive
|
| 83 |
-
- `POST /api/v1/story_editor/generate_outline` - Generate outline
|
| 84 |
-
- `POST /api/v1/cultural_consultant/review_outline` - Review outline
|
| 85 |
-
- `POST /api/v1/lead_writer/write_script` - Write script
|
| 86 |
-
- `POST /api/v1/dialogue_specialist/polish_dialogue` - Polish dialogue
|
| 87 |
-
- `POST /api/v1/comedy_writer/add_humor` - Add humor
|
| 88 |
-
- `POST /api/v1/proofreader/final_qc` - Final QC
|
| 89 |
-
|
| 90 |
-
## Architecture
|
| 91 |
-
|
| 92 |
-
```
|
| 93 |
-
FastAPI Server (Port 7860)
|
| 94 |
-
↓
|
| 95 |
-
Pipeline Orchestrator
|
| 96 |
-
↓
|
| 97 |
-
7 Agent Modules
|
| 98 |
-
↓
|
| 99 |
-
OpenRouter API (poolside/laguna-m.1:free)
|
| 100 |
-
↓
|
| 101 |
-
Hugging Face Dataset Upload
|
| 102 |
-
```
|
| 103 |
-
|
| 104 |
-
## Security
|
| 105 |
-
|
| 106 |
-
- **Secrets Management** - API keys stored securely in HF Secrets
|
| 107 |
-
- **No Hardcoded Credentials** - Environment variables loaded at runtime
|
| 108 |
-
- **HTTPS Only** - All communication encrypted
|
| 109 |
-
- **Private Space** - Recommended for production use
|
| 110 |
-
|
| 111 |
-
## Performance
|
| 112 |
-
|
| 113 |
-
Typical pipeline execution time: **10-15 minutes**
|
| 114 |
-
|
| 115 |
-
Each agent processes sequentially through the OpenRouter API:
|
| 116 |
-
1. Showrunner: ~40 seconds
|
| 117 |
-
2. Story Editor: ~150 seconds
|
| 118 |
-
3. Cultural Consultant: ~130 seconds
|
| 119 |
-
4. Lead Writer: ~140 seconds
|
| 120 |
-
5. Dialogue Specialist: ~50 seconds
|
| 121 |
-
6. Comedy Writer: ~120 seconds
|
| 122 |
-
7. Proofreader: ~40 seconds
|
| 123 |
-
|
| 124 |
-
## Storage
|
| 125 |
-
|
| 126 |
-
- **Local Storage** - Agent outputs saved in Space filesystem
|
| 127 |
-
- **Hugging Face Dataset** - Final outputs uploaded to `factorstudios/Pipeline`
|
| 128 |
-
- **Metadata** - Pipeline execution metadata also uploaded
|
| 129 |
-
|
| 130 |
-
## Troubleshooting
|
| 131 |
-
|
| 132 |
-
### 401 Unauthorized
|
| 133 |
-
- Check `OPENROUTER_API_KEY` is set correctly in Secrets
|
| 134 |
-
- Verify key has access to `poolside/laguna-m.1:free` model
|
| 135 |
-
|
| 136 |
-
### 403 Forbidden (Hugging Face)
|
| 137 |
-
- Check `HUGGINGFACE_TOKEN` is set correctly in Secrets
|
| 138 |
-
- Verify token has write access to dataset
|
| 139 |
-
- Confirm dataset exists: `factorstudios/Pipeline`
|
| 140 |
-
|
| 141 |
-
### Timeout Errors
|
| 142 |
-
- Pipeline execution can take 10-15 minutes
|
| 143 |
-
- Increase request timeout to 600+ seconds
|
| 144 |
-
- Check Space logs for details
|
| 145 |
-
|
| 146 |
-
### Out of Memory
|
| 147 |
-
- Spaces have limited memory
|
| 148 |
-
- Consider splitting pipeline into separate requests
|
| 149 |
-
- Use individual agent endpoints instead of full pipeline
|
| 150 |
-
|
| 151 |
-
## Logs
|
| 152 |
-
|
| 153 |
-
View Space logs in the Hugging Face Space interface for debugging.
|
| 154 |
-
|
| 155 |
-
## Support
|
| 156 |
-
|
| 157 |
-
For issues or questions:
|
| 158 |
-
1. Check the logs in your Space
|
| 159 |
-
2. Review API documentation at `/docs`
|
| 160 |
-
3. Verify all Secrets are configured correctly
|
| 161 |
-
|
| 162 |
-
## License
|
| 163 |
-
|
| 164 |
-
This project is part of Factor Studios' multi-agent content generation initiative.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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