|  | 
|  | 1 | +title: "Deploy" description: "Deploy your Apps to production with Hypermode" | 
|  | 2 | +"og:title": "Deploy - Apps" Deploying Apps to Production Once you've developed | 
|  | 3 | +and tested your App locally, you're ready to deploy it to production on | 
|  | 4 | +Hypermode. Hypermode provides a seamless deployment pipeline that takes your | 
|  | 5 | +Modus code and makes it available as a scalable, production-ready service. | 
|  | 6 | +Prerequisites Before deploying, ensure you have: | 
|  | 7 | + | 
|  | 8 | +- A Modus app with a valid modus.json configuration | 
|  | 9 | +- Authentication with Hypermode via the Hyp CLI | 
|  | 10 | +- A linked GitHub repository (for automatic deployments) Authentication Setup | 
|  | 11 | +  First, authenticate with Hypermode using the Hyp CLI: | 
|  | 12 | + | 
|  | 13 | +# Install the Hyp CLI if you haven't already | 
|  | 14 | + | 
|  | 15 | +npm install -g @hypermode/hyp-cli | 
|  | 16 | + | 
|  | 17 | +# Log into your Hypermode account | 
|  | 18 | + | 
|  | 19 | +hyp login This opens your browser and authenticates you with Hypermode, storing | 
|  | 20 | +your credentials locally for future deployments. Linking Your Repository To | 
|  | 21 | +enable automatic deployments, link your Modus app repository to Hypermode: | 
|  | 22 | + | 
|  | 23 | +# Navigate to your Modus app directory | 
|  | 24 | + | 
|  | 25 | +cd my-modus-app | 
|  | 26 | + | 
|  | 27 | +# Link the repository to Hypermode | 
|  | 28 | + | 
|  | 29 | +hyp link This process: | 
|  | 30 | + | 
|  | 31 | +- Connects your GitHub repository to your Hypermode workspace | 
|  | 32 | +- Sets up the necessary webhooks for automatic deployments | 
|  | 33 | +- Creates a Hypermode app linked to your repository Deployment Methods Automatic | 
|  | 34 | +  Deployment via Git The recommended approach is automatic deployment through | 
|  | 35 | +  Git. When you link your repository, Hypermode automatically deploys your app | 
|  | 36 | +  when you push to the main branch. | 
|  | 37 | + | 
|  | 38 | +# Make your changes and commit them | 
|  | 39 | + | 
|  | 40 | +git add . git commit -m "Update app logic" | 
|  | 41 | + | 
|  | 42 | +# Push to trigger deployment | 
|  | 43 | + | 
|  | 44 | +git push origin main Manual Deployment For immediate deployments or testing, you | 
|  | 45 | +can deploy directly from your local environment: | 
|  | 46 | + | 
|  | 47 | +# Deploy your current working directory | 
|  | 48 | + | 
|  | 49 | +modus deploy | 
|  | 50 | + | 
|  | 51 | +# Deploy a specific branch | 
|  | 52 | + | 
|  | 53 | +modus deploy --branch feature-branch | 
|  | 54 | + | 
|  | 55 | +# Deploy with custom environment variables | 
|  | 56 | + | 
|  | 57 | +modus deploy --env production Deployment Configuration Environment Variables | 
|  | 58 | +Configure environment variables for your production deployment in your | 
|  | 59 | +modus.json: { "connections": { "external-api": { "type": "http", "baseUrl": | 
|  | 60 | +"https://api.example.com/", "headers": { "Authorization": "Bearer {{API_KEY}}" } | 
|  | 61 | +} } } Set production environment variables through the Hypermode console or via | 
|  | 62 | +the CLI: | 
|  | 63 | + | 
|  | 64 | +# Set environment variables for production | 
|  | 65 | + | 
|  | 66 | +hyp env set API_KEY=your_production_api_key hyp env set | 
|  | 67 | +DATABASE_URL=your_production_db_url Build Configuration Ensure your modus.json | 
|  | 68 | +is properly configured for production: { "functions": "./functions", "models": { | 
|  | 69 | +"text-generator": { "sourceModel": "meta-llama/Llama-3.2-3B-Instruct", | 
|  | 70 | +"provider": "hugging-face", "connection": "hypermode" } }, "connections": { | 
|  | 71 | +"hypermode": { "type": "hypermode", "host": "https://api.hypermode.com" } } } | 
|  | 72 | +Deployment Pipeline When you deploy, Hypermode follows this process: | 
|  | 73 | + | 
|  | 74 | +1. Code Analysis: Validates your Modus configuration and code structure | 
|  | 75 | +2. Compilation: Compiles your Go or AssemblyScript code to WebAssembly | 
|  | 76 | +3. Model Setup: Configures and validates all specified AI models | 
|  | 77 | +4. Function Registration: Makes your functions available via GraphQL | 
|  | 78 | +5. Agent Deployment: Deploys any stateful agents with persistent memory | 
|  | 79 | +6. Health Checks: Verifies the deployment is healthy and responsive Production | 
|  | 80 | +   Features Automatic Scaling Your deployed Apps automatically scale based on | 
|  | 81 | +   demand: | 
|  | 82 | + | 
|  | 83 | +- Functions: Scale to zero when not in use, instant cold starts | 
|  | 84 | +- Agents: Maintain persistent memory while scaling compute resources | 
|  | 85 | +- Models: Shared model infrastructure with automatic load balancing Built-in | 
|  | 86 | +  Observability Production deployments include comprehensive observability: | 
|  | 87 | +- Function Logs: Real-time logs for all function executions | 
|  | 88 | +- Performance Metrics: Response times, error rates, and throughput | 
|  | 89 | +- Agent Monitoring: Memory usage and state transitions | 
|  | 90 | +- Model Analytics: Token usage and inference performance Security and Compliance | 
|  | 91 | +  Production deployments are secured by default: | 
|  | 92 | +- Automatic HTTPS: All endpoints served over secure connections | 
|  | 93 | +- API Authentication: Secure API key management | 
|  | 94 | +- Environment Isolation: Complete separation between development and production | 
|  | 95 | +- Audit Logging: Complete audit trail of all deployments and changes Managing | 
|  | 96 | +  Deployments Viewing Deployment Status Monitor your deployments through the | 
|  | 97 | +  Hypermode console or CLI: | 
|  | 98 | + | 
|  | 99 | +# Check deployment status | 
|  | 100 | + | 
|  | 101 | +hyp status | 
|  | 102 | + | 
|  | 103 | +# View recent deployments | 
|  | 104 | + | 
|  | 105 | +hyp deployments list | 
|  | 106 | + | 
|  | 107 | +# Get detailed logs | 
|  | 108 | + | 
|  | 109 | +hyp logs --follow Rolling Back Deployments If issues arise, quickly roll back to | 
|  | 110 | +a previous deployment: | 
|  | 111 | + | 
|  | 112 | +# List available versions | 
|  | 113 | + | 
|  | 114 | +hyp deployments list | 
|  | 115 | + | 
|  | 116 | +# Roll back to a specific deployment | 
|  | 117 | + | 
|  | 118 | +hyp rollback --version v1.2.3 | 
|  | 119 | + | 
|  | 120 | +# Roll back to the previous version | 
|  | 121 | + | 
|  | 122 | +hyp rollback --previous Blue-Green Deployments For zero-downtime deployments, | 
|  | 123 | +Hypermode supports blue-green deployment patterns: | 
|  | 124 | + | 
|  | 125 | +# Deploy to staging environment | 
|  | 126 | + | 
|  | 127 | +modus deploy --env staging | 
|  | 128 | + | 
|  | 129 | +# Promote staging to production after testing | 
|  | 130 | + | 
|  | 131 | +hyp promote staging production Custom Domains Configure custom domains for your | 
|  | 132 | +production Apps: | 
|  | 133 | + | 
|  | 134 | +# Add a custom domain | 
|  | 135 | + | 
|  | 136 | +hyp domain add api.mycompany.com | 
|  | 137 | + | 
|  | 138 | +# Configure SSL certificates (automatic with Let's Encrypt) | 
|  | 139 | + | 
|  | 140 | +hyp domain ssl enable api.mycompany.com CI/CD Integration For advanced | 
|  | 141 | +deployment workflows, integrate with your CI/CD pipeline: | 
|  | 142 | + | 
|  | 143 | +# .github/workflows/deploy.yml | 
|  | 144 | + | 
|  | 145 | +name: Deploy to Hypermode | 
|  | 146 | + | 
|  | 147 | +on: push: branches: [main] | 
|  | 148 | + | 
|  | 149 | +jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 | 
|  | 150 | + | 
|  | 151 | +      - name: Setup Node.js | 
|  | 152 | +        uses: actions/setup-node@v4 | 
|  | 153 | +        with: | 
|  | 154 | +          node-version: '22' | 
|  | 155 | + | 
|  | 156 | +      - name: Install Hyp CLI | 
|  | 157 | +        run: npm install -g @hypermode/hyp-cli | 
|  | 158 | + | 
|  | 159 | +      - name: Deploy to Hypermode | 
|  | 160 | +        run: modus deploy | 
|  | 161 | +        env: | 
|  | 162 | +          HYP_API_KEY: ${{ secrets.HYP_API_KEY }} | 
|  | 163 | + | 
|  | 164 | +Production Best Practices Performance Optimization | 
|  | 165 | + | 
|  | 166 | +- Use appropriate model sizes for your use case | 
|  | 167 | +- Implement proper error handling and retries | 
|  | 168 | +- Cache frequently accessed data | 
|  | 169 | +- Monitor memory usage in stateful agents Security | 
|  | 170 | +- Never commit API keys or secrets to version control | 
|  | 171 | +- Use environment variables for all sensitive configuration | 
|  | 172 | +- Regularly rotate API keys and credentials | 
|  | 173 | +- Implement proper input validation Monitoring | 
|  | 174 | +- Set up alerts for error rates and performance degradation | 
|  | 175 | +- Monitor agent memory usage and state persistence | 
|  | 176 | +- Track model inference costs and usage patterns | 
|  | 177 | +- Implement health checks for critical dependencies Cost Management | 
|  | 178 | +- Monitor token usage for AI models | 
|  | 179 | +- Use appropriate compute resources for your workload | 
|  | 180 | +- Implement rate limiting to prevent unexpected costs | 
|  | 181 | +- Consider model selection based on cost vs. performance trade-offs | 
|  | 182 | +  Troubleshooting Deployments Common Issues Build Failures | 
|  | 183 | + | 
|  | 184 | +# Check build logs | 
|  | 185 | + | 
|  | 186 | +hyp logs --build | 
|  | 187 | + | 
|  | 188 | +# Validate configuration locally | 
|  | 189 | + | 
|  | 190 | +modus build --validate Environment Variable Issues | 
|  | 191 | + | 
|  | 192 | +# List current environment variables | 
|  | 193 | + | 
|  | 194 | +hyp env list | 
|  | 195 | + | 
|  | 196 | +# Test with local environment | 
|  | 197 | + | 
|  | 198 | +modus dev --env production-like Model Configuration Problems | 
|  | 199 | + | 
|  | 200 | +# Test model connections | 
|  | 201 | + | 
|  | 202 | +hyp models test | 
|  | 203 | + | 
|  | 204 | +# Check model availability | 
|  | 205 | + | 
|  | 206 | +hyp models list --available Getting Help If you encounter deployment issues: | 
|  | 207 | + | 
|  | 208 | +- Check the deployment troubleshooting guide | 
|  | 209 | +- View real-time logs in the Hypermode console | 
|  | 210 | +- Contact support through the Hypermode dashboard | 
|  | 211 | +- Join the community Discord for peer support Your Apps are now ready for | 
|  | 212 | +  production use, with automatic scaling, built-in observability, and | 
|  | 213 | +  enterprise-grade security. The deployment process ensures your Modus code runs | 
|  | 214 | +  reliably in a production environment while maintaining the same development | 
|  | 215 | +  experience you're familiar with locally. | 
0 commit comments