Add Space landing page
Browse files- README.md +1 -1
- server/app.py +93 -0
README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
title: Model Release Env
|
| 3 |
sdk: docker
|
| 4 |
app_port: 8000
|
| 5 |
-
base_path: /
|
| 6 |
tags:
|
| 7 |
- openenv
|
| 8 |
- llm
|
|
|
|
| 2 |
title: Model Release Env
|
| 3 |
sdk: docker
|
| 4 |
app_port: 8000
|
| 5 |
+
base_path: /
|
| 6 |
tags:
|
| 7 |
- openenv
|
| 8 |
- llm
|
server/app.py
CHANGED
|
@@ -2,6 +2,8 @@
|
|
| 2 |
|
| 3 |
from __future__ import annotations
|
| 4 |
|
|
|
|
|
|
|
| 5 |
try:
|
| 6 |
from openenv.core.env_server.http_server import create_app
|
| 7 |
except ImportError as exc: # pragma: no cover
|
|
@@ -26,6 +28,97 @@ app = create_app(
|
|
| 26 |
)
|
| 27 |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
def main(host: str = "0.0.0.0", port: int = 8000) -> None:
|
| 30 |
import uvicorn
|
| 31 |
|
|
|
|
| 2 |
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
+
from fastapi.responses import HTMLResponse, RedirectResponse
|
| 6 |
+
|
| 7 |
try:
|
| 8 |
from openenv.core.env_server.http_server import create_app
|
| 9 |
except ImportError as exc: # pragma: no cover
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
|
| 31 |
+
LANDING_PAGE = """
|
| 32 |
+
<!DOCTYPE html>
|
| 33 |
+
<html lang="en">
|
| 34 |
+
<head>
|
| 35 |
+
<meta charset="utf-8" />
|
| 36 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 37 |
+
<title>Model Release Env</title>
|
| 38 |
+
<style>
|
| 39 |
+
body {
|
| 40 |
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
| 41 |
+
background: linear-gradient(180deg, #07111f 0%, #0b172b 100%);
|
| 42 |
+
color: #eef4ff;
|
| 43 |
+
margin: 0;
|
| 44 |
+
min-height: 100vh;
|
| 45 |
+
display: grid;
|
| 46 |
+
place-items: center;
|
| 47 |
+
}
|
| 48 |
+
main {
|
| 49 |
+
width: min(760px, calc(100vw - 32px));
|
| 50 |
+
padding: 32px;
|
| 51 |
+
border-radius: 24px;
|
| 52 |
+
background: rgba(12, 24, 44, 0.9);
|
| 53 |
+
border: 1px solid rgba(142, 182, 255, 0.22);
|
| 54 |
+
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
|
| 55 |
+
}
|
| 56 |
+
h1 {
|
| 57 |
+
margin: 0 0 12px;
|
| 58 |
+
font-size: clamp(2rem, 5vw, 3rem);
|
| 59 |
+
line-height: 1.05;
|
| 60 |
+
}
|
| 61 |
+
p {
|
| 62 |
+
margin: 0 0 16px;
|
| 63 |
+
color: #c8d8f8;
|
| 64 |
+
line-height: 1.6;
|
| 65 |
+
}
|
| 66 |
+
.grid {
|
| 67 |
+
display: grid;
|
| 68 |
+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
| 69 |
+
gap: 12px;
|
| 70 |
+
margin-top: 24px;
|
| 71 |
+
}
|
| 72 |
+
a {
|
| 73 |
+
display: block;
|
| 74 |
+
padding: 14px 16px;
|
| 75 |
+
border-radius: 14px;
|
| 76 |
+
text-decoration: none;
|
| 77 |
+
color: #f8fbff;
|
| 78 |
+
background: rgba(80, 127, 255, 0.16);
|
| 79 |
+
border: 1px solid rgba(122, 166, 255, 0.26);
|
| 80 |
+
}
|
| 81 |
+
a span {
|
| 82 |
+
display: block;
|
| 83 |
+
color: #b7caf1;
|
| 84 |
+
font-size: 0.92rem;
|
| 85 |
+
margin-top: 6px;
|
| 86 |
+
}
|
| 87 |
+
code {
|
| 88 |
+
color: #ffe59a;
|
| 89 |
+
}
|
| 90 |
+
</style>
|
| 91 |
+
</head>
|
| 92 |
+
<body>
|
| 93 |
+
<main>
|
| 94 |
+
<h1>Model Release Env</h1>
|
| 95 |
+
<p>
|
| 96 |
+
Deterministic OpenEnv environment for LLM release-readiness decisions.
|
| 97 |
+
Use <code>POST /reset</code> to start an episode, <code>POST /step</code>
|
| 98 |
+
to act, and <code>GET /state</code> to inspect progress.
|
| 99 |
+
</p>
|
| 100 |
+
<div class="grid">
|
| 101 |
+
<a href="/docs">API Docs<span>Swagger UI for reset, step, state, schema, and metadata</span></a>
|
| 102 |
+
<a href="/schema">Schema<span>Typed action and observation contract</span></a>
|
| 103 |
+
<a href="/health">Health<span>Simple readiness status for deployment checks</span></a>
|
| 104 |
+
<a href="/metadata">Metadata<span>Environment information and capability summary</span></a>
|
| 105 |
+
</div>
|
| 106 |
+
</main>
|
| 107 |
+
</body>
|
| 108 |
+
</html>
|
| 109 |
+
"""
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
@app.get("/", include_in_schema=False)
|
| 113 |
+
def landing_page() -> HTMLResponse:
|
| 114 |
+
return HTMLResponse(LANDING_PAGE)
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
@app.get("/web", include_in_schema=False)
|
| 118 |
+
def legacy_web_redirect() -> RedirectResponse:
|
| 119 |
+
return RedirectResponse(url="/", status_code=307)
|
| 120 |
+
|
| 121 |
+
|
| 122 |
def main(host: str = "0.0.0.0", port: int = 8000) -> None:
|
| 123 |
import uvicorn
|
| 124 |
|