-
Notifications
You must be signed in to change notification settings - Fork 23
Add Multi-Cloud Serverless Deployment Architecture with Modal.ai Implementation #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
klappy
wants to merge
10
commits into
isi-nlp:master
Choose a base branch
from
klappy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add Python integration tests (19 tests, all passing) * Multi-script romanization (Russian, Greek, Hindi, Arabic, etc.) * CLI interface testing * File-based romanization * Caching performance * Serverless readiness checks - Add JavaScript core tests (2 tests, all passing) * Core logic (script detection, caching, validation) * uroman integration with fallback handling - Add dedicated test runner for core tests - Add comprehensive documentation - Remove duplicate/broken test files - All tests independent of serverless/MCP implementation
- Created basic and production-ready Modal deployment scripts - Added comprehensive documentation and deployment guide - Included batch processing, health checks, and error handling - Set up auto-scaling serverless infrastructure - Added requirements file for Modal dependencies This provides a clean alternative to Cloudflare Workers with: - No timeout limitations (vs 30s on CF Workers) - Native Python support (no JavaScript transpilation needed) - Better suited for ML/AI workloads - Pay-per-second billing with scale-to-zero
- Removed dist/ directory with Cloudflare build artifacts - Removed all .cjs test files from tests/core/ - Removed tests/run-core-tests.cjs - No more JavaScript, TypeScript, or Node.js files - Pure Python implementation with Modal.ai deployment
- Created comprehensive test suite covering all 23 languages - Added local vs remote performance comparison tests - Added tipping point analysis (remote better at >500 req/s) - Removed all __pycache__ directories - Updated .gitignore for Python development - Added project summary and Modal deployment documentation - 100% test coverage with real-world examples from each language Test results: - All 23 languages: 100% success rate - Local performance: 1ms average, 2,577 req/s - Remote performance: 256ms average, scales infinitely - Tipping point: Remote beneficial at >500 req/s
- Remove uroman_modal.py, uroman_modal_v2.py, uroman_modal_fixed.py - These were development iterations, not needed for final PR - Keep only the actively deployed versions: - uroman_modal_simple.py (REST API) - uroman_mcp_modal.py (MCP server) - uroman_modal_production.py (production template) - Update documentation to reference correct deployment files - Remove Python cache files (already in .gitignore)
- Create platform-agnostic core components: - RomanizerService: Core romanization logic - UromanHandler: HTTP request handling - MCPHandler: MCP protocol for AI assistants - Implement adapter pattern for multiple platforms: - BaseAdapter: Abstract base class - ModalAdapter: Modal.ai implementation - AWSLambdaAdapter: AWS Lambda implementation - CloudflareAdapter: Cloudflare Workers skeleton - Add deployment configurations: - Modal: Fully working deployment - AWS: SAM template and Lambda handler - Ready for Cloudflare, Vercel, etc. - Benefits: - Deploy to any serverless platform with minimal changes - Shared business logic across all platforms - Unified testing and API interface - Professional enterprise-ready structure - Tested and deployed: - Modal endpoints working with new architecture - Tests passing for adapters - Migration guide for existing deployments
- Add comprehensive LIMITATIONS.md explaining why CF Workers don't work: - 10MB size limit (uroman needs 13-15MB) - No regex module (only basic re) - Experimental Python with missing Unicode support - Document all failed optimization attempts - Update serverless README with platform compatibility matrix - Add warnings to CloudflareAdapter - throws NotImplementedError - Update PROJECT_SUMMARY with lessons learned This will save others from wasting time trying to deploy to Cloudflare. Modal.ai and AWS Lambda remain the recommended platforms.
BREAKING CHANGE: Complete restructuring of deployment code - Remove old modal-deployment/ directory - All functionality moved to serverless/ multi-cloud architecture - Preserve all tests, performance tools, and documentation - Update all endpoints to use new deployment File movements: - Tests → serverless/tests/performance/ - Docs → serverless/docs/ - Config → serverless/deployments/modal/ - Old Modal scripts removed (replaced by adapters) Benefits: - Cleaner, more professional structure - Multi-cloud ready (not just Modal) - Better separation of concerns - Easier to maintain and extend All functionality preserved and tested: - ✅ REST API working - ✅ MCP server working - ✅ All tests passing - ✅ Performance unchanged - ✅ Documentation updated
- Add .cursorrules for Cursor AI integration - Add comprehensive Cursor MCP testing guides - Add example code for using MCP in Cursor projects - Add performance comparison tool (REST vs MCP) - Move all files to proper locations in serverless/ All files organized: - serverless/docs/ - Documentation and guides - serverless/tests/ - Integration examples - serverless/tests/performance/ - Performance tools Clean root directory - no junk files! Deployment verified working after reorganization.
- Move PROJECT_SUMMARY.md to serverless/ - Move README_MODAL_SECTION.md to serverless/ - Keep root directory clean and uncluttered - No files added to root - only original uroman files remain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Multi-Cloud Serverless Deployment Architecture with Modal.ai Implementation
Summary
This PR adds serverless deployment capabilities to uroman, enabling it to run as a cloud service. The implementation provides a clean, extensible multi-cloud architecture with Modal.ai as the primary deployment platform.
Key Features
1. Multi-Cloud Serverless Architecture (
serverless/)2. Modal.ai Deployment ✅
https://klappy--uroman-service-romanize-endpoint.modal.runhttps://klappy--uroman-service-mcp-endpoint.modal.run(for AI assistants)3. Comprehensive Test Suite
4. MCP (Model Context Protocol) Support
.cursorrulesPerformance Analysis
Important Learnings Documented
Cloudflare Workers Limitations ❌
After extensive testing, we documented why Cloudflare Workers cannot support uroman:
regexmodule supportserverless/deployments/cloudflare/LIMITATIONS.mdfor detailsChanges Overview
Added
serverless/- Complete multi-cloud architecturecore/- Platform-agnostic business logic