forked from Mirix-AI/MIRIX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (32 loc) · 1.09 KB
/
Copy pathmain.py
File metadata and controls
46 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
"""
Mirix - AI Assistant Application
Entry point for the Mirix application.
"""
import argparse
import os
import sys
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# Add the project root to the Python path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
def main():
"""Main entry point for Mirix application."""
parser = argparse.ArgumentParser(description="Mirix AI Assistant Server")
parser.add_argument("--host", default="0.0.0.0", help="Host to bind the server to")
parser.add_argument(
"--port", type=int, default=None, help="Port to bind the server to"
)
args = parser.parse_args()
# Determine port from command line, environment variable, or default
port = args.port
if port is None:
port = int(os.environ.get("PORT", 47283))
print(f"Starting Mirix server on {args.host}:{port}")
import uvicorn
from mirix.server import app
uvicorn.run(app, host=args.host, port=port)
if __name__ == "__main__":
main()