๐ Async-first, idiot-proof Gradio deployment CLI for Modal
Project description
๐ modal-for-noobs
Async-first, idiot-proof Gradio deployment CLI for Modal
Deploy your Gradio apps to Modal with zero configuration. Perfect for noobs who just want things to work! ๐ฏ
โจ Features
- ๐ Zero-config deployment - Just point at your Gradio app and go!
- โก --time-to-get-serious - Migrate HuggingFace Spaces to Modal in seconds
- ๐ Async-first - Built with modern Python async/await patterns using uvloop
- ๐ฏ Three modes: Minimum (CPU), Optimized (GPU + ML), Gra-Jupy (Jupyter + Gradio)
- ๐ Auto-authentication - Handles Modal setup automatically
- ๐ช Smart detection - Finds your Gradio interface automatically
- ๐ฆ Dependency magic - Auto-installs requirements from HF Spaces or drop folder
- ๐งโโ๏ธ Interactive wizard - Step-by-step deployment guidance
- ๐ฅ Log milking - Beautiful log viewing with --milk-logs
- ๐ Deployment killer - Easy cleanup with --kill-a-deployment
- ๐ Modal Examples Explorer - Browse and deploy Modal's example gallery
- ๐ Beautiful UI - Modal's signature green theme throughout
- ๐ง๐ท Modo brasileiro - Brazilian Portuguese support with --br-huehuehue
๐ Quick Start
1. Installation
# Clone and install
git clone https://github.com/arthrod/modal-for-noobs.git
cd modal-for-noobs
uv sync
# Or install directly (future)
pip install modal-for-noobs
2. Deploy Your Gradio App
# ๐ SUPER EASY MODE - Just use our launcher scripts!
# Unix/Linux/macOS
./mn.sh app.py # Quick deploy (CPU)
./mn.sh app.py --optimized # GPU + ML libraries
./mn.sh # Wizard mode (default)
# Windows
mn.bat app.py # Quick deploy (CPU)
mn.bat app.py --optimized # GPU + ML libraries
mn.bat # Wizard mode (default)
# ๐ก Install permanent 'mn' alias to use from anywhere!
./mn.sh --install-alias # Unix/Linux/macOS
mn.bat --install-alias # Windows
# Then just use 'mn' from anywhere:
mn app.py --optimized
mn --milk-logs # View deployment logs
# Alternative: Direct CLI usage (if installed via pip)
modal-for-noobs deploy my_app.py --dry-run
modal-for-noobs deploy my_app.py --wizard # Interactive wizard
modal-for-noobs deploy my_app.py --gra-jupy # Jupyter + Gradio combo
# Configuration commands
modal-for-noobs config # Show configuration (new command)
modal-for-noobs config-info # Legacy alias (backward compatible)
# MCP Server for IDE integration
modal-for-noobs mcp # Start MCP server on port 8000
modal-for-noobs mcp --port 9000 # Use custom port
๐ Detailed Examples
๐ฏ Simple Gradio App
Create a file my_app.py:
import gradio as gr
def greet(name):
return f"Hello {name}! ๐"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch()
Deploy it:
./mn.sh my_app.py --optimized
๐ง ML Model App with Custom Requirements
- Create
drop-ur-precious-stuff-here/requirements.txt:
transformers==4.35.0
torch>=2.0.0
accelerate
- Create your ML app:
import gradio as gr
from transformers import pipeline
# The wizard will automatically detect and include your requirements!
classifier = pipeline("sentiment-analysis")
def analyze_sentiment(text):
result = classifier(text)
return f"Sentiment: {result[0]['label']} ({result[0]['score']:.2f})"
demo = gr.Interface(
fn=analyze_sentiment,
inputs="text",
outputs="text",
title="๐ง Sentiment Analysis with Modal-for-noobs!"
)
if __name__ == "__main__":
demo.launch()
- Deploy with wizard:
./mn.sh ml_app.py --wizard
๐ง๐ท Modo Brasileiro (Brazilian Mode)
./mn.sh meu_app.py --optimized --br-huehuehue
# Outputs everything in Portuguese with Brazilian humor! ๐
๐ ๏ธ Advanced Commands
๐ฅ Milk the Logs (View Deployment Logs)
mn --milk-logs # List all apps
mn --milk-logs my-app # View logs for specific app
mn --milk-logs my-app --follow # Follow logs in real-time
mn --milk-logs my-app --br-huehuehue # Brazilian mode logs! ๐ง๐ท
๐ Kill Deployments
mn --kill-a-deployment # List active deployments
mn --kill-a-deployment my-app-id # Kill specific deployment
mn --kill-a-deployment --br-huehuehue # Brazilian terminator mode! ๐
๐ Sanity Check
mn --sanity-check # Check what's deployed
mn --sanity-check --br-huehuehue # Brazilian sanity check! ๐ง
๐ช Time to Get SERIOUS! (HuggingFace Migration)
# The nuclear option - migrate HuggingFace Spaces! ๐
modal-for-noobs time-to-get-serious https://huggingface.co/spaces/user/space-name
# With dry run (see what happens first)
modal-for-noobs time-to-get-serious https://huggingface.co/spaces/user/space-name --dry-run
4. Authentication (auto-setup!)
# If no Modal keys found, it automatically starts auth setup!
# But you can also manually trigger it:
modal-for-noobs auth
CLI Commands
deploy- deploy a Gradio appmn- quick deploy alias fordeploytime-to-get-serious- migrate a HuggingFace Spaceauth- configure Modal credentialskill-a-deployment- stop a running deploymentsanity-check- list active deploymentsconfig- show configuration infomcp- start a local MCP server for Claude, Cursor, Roo and VSCode
The MCP server exposes several core RPC methods:
list_toolscall_toollist_resourcesread_resourcelist_promptsget_prompt
๐ ๏ธ Development
Adding Dependencies
uv add requests # Add runtime dependency
uv add pytest --dev # Add development dependency
Code Quality
uv run ruff check # Lint code
uv run ruff format # Format code
uv run mypy src/ # Type check
uv run pytest # Run tests
Pre-commit Hooks
The project uses pre-commit hooks to ensure code quality:
- Trailing whitespace removal
- YAML/TOML/JSON validation
- Ruff linting and formatting
- MyPy type checking
- Bandit security checks
๐ฅ Contributing
- ๐ด Fork the repository
- ๐ฟ Create your feature branch (git checkout -b feature/amazing-feature)
- ๐พ Commit your changes (git commit -m 'Add some amazing feature')
- ๐ข Push to the branch (git push origin feature/amazing-feature)
- ๐ Open a Pull Request
โ ๏ธ Trusted publishing failure
That's good news!
You are not able to publish to PyPI unless you have registered your project on PyPI. You get the following message:
Trusted publishing exchange failure:
Token request failed: the server refused the request for
the following reasons:
invalid-publisher: valid token, but no corresponding
publisher (All lookup strategies exhausted)
This generally indicates a trusted publisher
configuration error, but could
also indicate an internal error on GitHub or PyPI's part.
The claims rendered below are for debugging purposes only.
You should not
use them to configure a trusted publisher unless they
already match your expectations.
Please register your repository. The 'release.yml' flow is publishing from the 'release' environment. Once you have registered your new repo it should all work.
๐ Credits
Made with <3 by Neurotic Coder and assisted by Beloved Claude โจ
This project represents the beautiful chaos of neurotic coding meets AI assistance - resulting in something absolutely AMAZING! ๐๐
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modal_for_noobs-0.3.0.tar.gz.
File metadata
- Download URL: modal_for_noobs-0.3.0.tar.gz
- Upload date:
- Size: 137.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb97718172eb6688c8ad0ad8a44ed0dd1d7dc55627e53f37c148b99a2ba43095
|
|
| MD5 |
622993e7e5fe5a0e4fd1c8ea83589cfa
|
|
| BLAKE2b-256 |
9444883980cab6eb4781bd6b0e75aa68df770fa81fc296e970bf4529015127f1
|
File details
Details for the file modal_for_noobs-0.3.0-py3-none-any.whl.
File metadata
- Download URL: modal_for_noobs-0.3.0-py3-none-any.whl
- Upload date:
- Size: 193.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7115ad71209fb5bb3786c6e8eb85accf43ae2e3cbb14ee68ac92eb1cab4b5300
|
|
| MD5 |
f2fddfff4d2d278704567b4cdd506093
|
|
| BLAKE2b-256 |
0d1ee52ad26c6b53916d39d3c71a7016d1ccaf27d47cd4892f9561743d04d185
|