--- title: Fyodor IDE emoji: πŸ’» colorFrom: blue colorTo: gray sdk: gradio sdk_version: 6.0.1 app_file: app.py pinned: true license: mit short_description: A small demo of a future IDE named Fyodor-IDE tags: - mcp-in-action-track-enterprise --- # πŸ›‘οΈ Fyodor IDE **Isolated AI Coding Environment for Secure Python Development** A secure, enterprise-grade AI coding assistant that executes code in ephemeral cloud sandboxes. Built with Gradio 6, MiniMax, and E2B for zero-trust code execution. --- ## πŸš€ Features ### 1. Zero-Trust Security Architecture - **Sandboxed Execution**: All Python code runs in E2B (Firecracker VMs), ensuring complete isolation from the host server - **No Internet Access**: The agent is restricted to internal tools and libraries, preventing unauthorized data exfiltration - **Ephemeral Environments**: Each execution starts fresh with no persistent state ### 2. "Mini IDE" Experience - **Dual-Column Layout**: Chat interface on the left, live code editor on the right - **Live Edits**: Modify AI-generated code directly in the browser and re-run it instantly - **Artifact Support**: Renders matplotlib plots, pandas DataFrames, and images inline - **Syntax Highlighting**: Full Python code highlighting for better readability ### 3. Enterprise Session Management - **Time-Boxed Sessions**: Every session hard-resets after 15 minutes for security - **State Isolation**: User states (history, code) are kept in memory and never written to disk - **No Persistent Storage**: Ensures complete data privacy and compliance ### 4. Mobile Responsive - **Adaptive Layout**: Full responsive CSS that stacks vertically on mobile devices - **Coding on the Go**: Access your AI coding assistant from any device --- ## ☁️ Deployment on Hugging Face Spaces ### Quick Start 1. **Create a New Space** - Go to [Hugging Face Spaces](https://huggingface.co/spaces) - Click "Create new Space" - Select **Gradio** as the SDK - Choose a name for your Space (e.g., `fyodor-ide`) 2. **Upload Files** - Upload `app.py` and `requirements.txt` to your Space 3. **Configure Secrets** - Navigate to **Settings β†’ Variables and secrets** - Add the following secrets: - `MINIMAX_API_KEY`: Your MiniMax API key ([Get one here](https://www.minimaxi.com/)) - `E2B_API_KEY`: Your E2B API key ([Get one here](https://e2b.dev/)) - `HF_TOKEN`: *(Optional)* Your Hugging Face token if using HF inference models 4. **Launch** - Your Space will build and launch automatically - Access your IDE at `https://huggingface.co/spaces/YOUR_USERNAME/fyodor-ide` ### Environment Variables | Variable | Required | Description | |----------|----------|-------------| | `MINIMAX_API_KEY` | βœ… Yes | API key for MiniMax AI model | | `E2B_API_KEY` | βœ… Yes | API key for E2B sandbox execution | | `HF_TOKEN` | ⬜ Optional | Hugging Face token for additional models | --- ## πŸ—οΈ Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ User │────────▢│ Fyodor IDE │────────▢│ MiniMax-M2 β”‚ β”‚ Browser β”‚ β”‚ Gradio UI β”‚ β”‚ AI Model β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Code Editor │◀────────│Python Code β”‚ β”‚ (Live) β”‚ β”‚ Generation β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ E2B Sandbox β”‚ β”‚ (Firecracker)β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Logs, Plots β”‚ β”‚ & Output β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## πŸ“ Usage Guide ### Basic Workflow 1. **Ask**: Type a coding request like *"Simulate a stock price random walk and plot it"* 2. **View**: The AI generates Python code in the right-hand editor panel 3. **Edit**: Modify parameters or logic directly in the code editor 4. **Run**: Click **▢️ Run Modified Code** to execute in the secure sandbox 5. **Export**: Click **⬇️ Export .py** to download your code before the session expires ### Example Prompts - *"Create a pandas DataFrame with sales data and plot a bar chart"* - *"Generate 1000 random numbers and show a histogram"* - *"Implement quicksort and visualize the sorting process"* - *"Fetch iris dataset and train a simple classifier"* ### Session Management - **Session Duration**: 15 minutes maximum - **Auto-Reset**: Sessions automatically clear after timeout - **No Persistence**: Export your work before leaving! --- ## πŸ› οΈ Tech Stack - **Frontend**: Gradio 6 (Python web framework) - **AI Model**: MiniMax-M2 (code generation) - **Sandbox**: E2B (Firecracker VM isolation) - **Language**: Python 3.10+ --- ## πŸ”’ Security Features - βœ… **Zero Network Access**: Sandboxes cannot access the internet - βœ… **Process Isolation**: Each execution runs in a separate VM - βœ… **Time-Limited Sessions**: Automatic session expiration - βœ… **No Disk Persistence**: All data stays in memory - βœ… **Input Sanitization**: Code is validated before execution --- ## πŸ“‹ Requirements ```txt gradio>=6.0.0 e2b-code-interpreter openai # or your preferred AI SDK python-dotenv ``` --- ## 🀝 Contributing This project is designed for Hugging Face Spaces deployment. To suggest improvements: 1. Fork this Space 2. Make your changes 3. Submit a pull request or discussion thread --- ## πŸ“„ License MIT License - See LICENSE file for details --- ## πŸ†˜ Support - **Issues**: Open a discussion in your Hugging Face Space - **Documentation**: [E2B Docs](https://e2b.dev/docs) | [Gradio Docs](https://gradio.app/docs) - **Community**: [Hugging Face Discord](https://discord.gg/huggingface) --- ## ⚠️ Disclaimer This tool executes arbitrary code in sandboxed environments. While E2B provides strong isolation, always review generated code before execution. Not recommended for production data processing without additional security review. --- **Built with ❀️ for secure AI-assisted development**