neurostack-in commited on
Commit
edc16c8
·
verified ·
1 Parent(s): 08a13ce

Update neuro-router-2/neuro_router/app/main.py

Browse files
neuro-router-2/neuro_router/app/main.py CHANGED
@@ -1,44 +1,39 @@
1
- from fastapi import FastAPI
2
- from fastapi.middleware.cors import CORSMiddleware
3
-
4
- from .config import settings
5
- from .routers.openai_proxy import router as openai_router
6
-
7
- app = FastAPI(
8
- title="NeuroStack OpenAI-Compatible Proxy",
9
- description="OpenAI-compatible API that routes to Groq's Llama Maverick model",
10
- version="1.0.0",
11
- docs_url="/docs",
12
- redoc_url="/redoc",
13
- )
14
-
15
- # CORS
16
- app.add_middleware(
17
- CORSMiddleware,
18
- allow_origins=[o.strip() for o in settings.cors_allow_origins.split(",") if o.strip()],
19
- allow_credentials=True,
20
- allow_methods=["*"],
21
- allow_headers=["*"],
22
- )
23
-
24
- # Include routers
25
- app.include_router(openai_router)
26
-
27
-
28
- @app.get("/")
29
- async def root():
30
- return {
31
- "service": "NeuroStack OpenAI Proxy",
32
- "status": "online",
33
- "endpoints": {
34
- "chat_completions": "/v1/chat/completions",
35
- "completions": "/v1/completions",
36
- "models": "/v1/models"
37
- },
38
- "auth": "Required - Bearer neurostack_XXXXXXXXXXXXX (13 alphanumeric chars)"
39
- }
40
-
41
-
42
- @app.get("/healthz")
43
- async def healthz():
44
- return {"status": "ok"}
 
1
+ from fastapi import FastAPI
2
+ from fastapi.middleware.cors import CORSMiddleware
3
+
4
+ from .config import settings
5
+ from .routers.openai_proxy import router as openai_router
6
+
7
+ app = FastAPI(
8
+ title="NeuroStack OpenAI-Compatible Proxy",
9
+ description="OpenAI-compatible API that routes to Groq's Llama Maverick model",
10
+ version="1.0.0",
11
+ docs_url="/docs",
12
+ redoc_url="/redoc",
13
+ )
14
+
15
+ # CORS
16
+ app.add_middleware(
17
+ CORSMiddleware,
18
+ allow_origins=[o.strip() for o in settings.cors_allow_origins.split(",") if o.strip()],
19
+ allow_credentials=True,
20
+ allow_methods=["*"],
21
+ allow_headers=["*"],
22
+ )
23
+
24
+ # Include routers
25
+ app.include_router(openai_router)
26
+
27
+
28
+ @app.get("/")
29
+ async def root():
30
+ return {
31
+ "service": "Neurorouter",
32
+ "status": "online",
33
+ "auth": "Required - Bearer neurostack_XXXXXXXXXXXXX (13 alphanumeric chars)"
34
+ }
35
+
36
+
37
+ @app.get("/healthz")
38
+ async def healthz():
39
+ return {"status": "ok"}