Skip to content

Commit b45379a

Browse files
committed
*
1 parent c0e2dca commit b45379a

File tree

4 files changed

+407
-4
lines changed

4 files changed

+407
-4
lines changed

apps/deploy.mdx

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
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.

apps/develop.mdx

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
title: "Develop"
3+
description: "Build and iterate on your Apps locally or in Threads"
4+
"og:title": "Develop - Apps"
5+
---
6+
7+
## Developing Apps in Hypermode
8+
9+
Hypermode supports two complementary approaches for building Apps: **code-first
10+
development** using Modus locally and **conversational development** using
11+
Threads. For conversational development, see our Threads documentation.
12+
13+
## Code-first development with Modus
14+
15+
For developers who prefer working with code, Modus provides a complete local
16+
development environment. This approach gives you full control over your App's
17+
structure, version control integration, and the ability to work within your
18+
existing development tools.
19+
20+
### Setting up local development
21+
22+
Install the Modus CLI to start building Apps locally:
23+
24+
```bash
25+
npm install -g @hypermode/modus-cli
26+
```
27+
28+
Create a new App:
29+
30+
```bash
31+
modus new my-app
32+
cd my-app
33+
```
34+
35+
This scaffolds a complete App structure with:
36+
37+
- Agent definitions and configurations
38+
- Function definitions for custom tools
39+
- Model integrations and connections
40+
- Environment configuration
41+
- Testing framework
42+
43+
### Local development workflow
44+
45+
When developing locally, you get the full Modus runtime experience:
46+
47+
```bash
48+
# Start local development server
49+
modus dev
50+
51+
# Build your app
52+
modus build
53+
```
54+
55+
Your local environment includes:
56+
57+
- **Hot reload** for rapid iteration with fast refresh
58+
- **Built-in debugging** with full observability
59+
- **API Explorer** for testing functions and agents interactively
60+
- **Model experimentation** with easy model swapping via Model Router
61+
- **Environment management** with `.env` files
62+
63+
### Local development environment
64+
65+
When you run `modus dev`, you get:
66+
67+
- **Local server** running at `http://localhost:8686`
68+
- **API Explorer** at `http://localhost:8686/explorer` for interactive testing
69+
- **Automatic compilation** of your Go or AssemblyScript code to WebAssembly
70+
- **Fast refresh** that preserves app state during development
71+
- **Environment variable substitution** from `.env.dev.local` files
72+
73+
### Code structure
74+
75+
Apps follow the Modus project structure that scales from simple functions to
76+
complex agent systems:
77+
78+
```
79+
my-app/
80+
├── main.go # Functions and agent definitions
81+
├── modus.json # App configuration and manifest
82+
├── .env.dev.local # Local environment variables
83+
├── go.mod # Dependencies (Go projects)
84+
└── README.md # Project documentation
85+
```
86+
87+
### Environment and secrets management
88+
89+
Modus handles environment variables and secrets securely:
90+
91+
```json modus.json
92+
{
93+
"connections": {
94+
"external-api": {
95+
"type": "http",
96+
"baseUrl": "https://api.example.com/",
97+
"headers": {
98+
"Authorization": "Bearer {{API_KEY}}"
99+
}
100+
}
101+
}
102+
}
103+
```
104+
105+
Set your environment variables in `.env.dev.local`:
106+
107+
```text .env.dev.local
108+
MODUS_EXTERNAL_API_API_KEY="your_api_key_here"
109+
```
110+
111+
Modus automatically substitutes `{{API_KEY}}` with `MODUS_EXTERNAL_API_API_KEY`
112+
following the naming convention: `MODUS_<CONNECTION_NAME>_<PLACEHOLDER>`.
113+
114+
### Using Hypermode-hosted models
115+
116+
To access Hypermode's Model Router and hosted models locally:
117+
118+
```bash
119+
# Install Hyp CLI for authentication
120+
npm install -g @hypermode/hyp-cli
121+
122+
# Authenticate with Hypermode
123+
hyp login
124+
```
125+
126+
Once authenticated, your local Modus environment automatically connects to
127+
Hypermode's model infrastructure, giving you access to multiple AI models for
128+
development and testing.
129+
130+
## Collaborative development
131+
132+
Both approaches support team collaboration:
133+
134+
### Code-first teams
135+
136+
- Standard Git workflows with branching and pull requests
137+
- Shared development environments
138+
- Code reviews for agent logic and function implementations
139+
- Automated testing and CI/CD integration
140+
141+
### Mixed teams
142+
143+
- Subject matter experts build and refine using Threads (see our Threads
144+
documentation)
145+
- Developers enhance and productionize Modus code
146+
- Seamless handoff between exploration and implementation
147+
- Shared testing environments using `modus dev`
148+
149+
## Testing and debugging
150+
151+
Hypermode provides comprehensive testing tools for both development approaches:
152+
153+
### Built-in testing with Modus
154+
155+
- **API Explorer**: Interactive testing of functions and agents
156+
- **Agent behavior tests**: Verify reasoning and decision-making
157+
- **Function integration tests**: Test external API calls and data processing
158+
- **Memory tests**: Validate state persistence and retrieval
159+
- **End-to-end scenarios**: Test complete workflows
160+
161+
### Observability and debugging
162+
163+
- **Execution tracing**: See every step of agent reasoning
164+
- **Function call monitoring**: Track all external interactions
165+
- **Memory access logs**: Understand how agents use context
166+
- **Performance metrics**: Monitor response times and resource usage
167+
- **Real-time logs**: Debug issues as they happen during development
168+
169+
## Environment management
170+
171+
Apps support multiple environments throughout development:
172+
173+
### Local development
174+
175+
- Full-featured Modus runtime with `modus dev`
176+
- Mock external services for testing
177+
- Hot reload and instant feedback
178+
- Local memory persistence
179+
- API Explorer for interactive testing
180+
181+
Whether you're a developer who prefers code, Hypermode's development experience
182+
provides the tools you need to build production-ready Apps using the power of
183+
the Modus runtime.

apps/monitor.mdx

Whitespace-only changes.

0 commit comments

Comments
 (0)