24f3001764/llm_code_deployment
0
1"""2Startup script for LLM Code Deployment API3Validates setup and starts the server4"""5import sys6import subprocess7from pathlib import Path8 9def main():10 """Run validation and start server"""11 print("\n๐ Starting LLM Code Deployment API...\n")12 13 # Run validation14 print("Step 1: Validating setup...")15 result = subprocess.run([sys.executable, "validate_setup.py"], capture_output=False)16 17 if result.returncode != 0:18 print("\nโ Setup validation failed. Please fix the issues above.")19 return 120 21 print("\n" + "=" * 60)22 print("Step 2: Starting FastAPI server...")23 print("=" * 60)24 print("\n๐ก Server will be available at: http://localhost:7860")25 print("๐ก API documentation at: http://localhost:7860/docs")26 print("๐ก Press Ctrl+C to stop the server\n")27 28 # Start the server29 try:30 subprocess.run([31 sys.executable, "-m", "uvicorn",32 "src.main:app",33 "--host", "0.0.0.0",34 "--port", "7860",35 "--reload"36 ])37 except KeyboardInterrupt:38 print("\n\n๐ Server stopped. Goodbye!")39 return 040 41if __name__ == "__main__":42 sys.exit(main())43 