Spaces:
Sleeping
Sleeping
Clean native Docker deployment setup for InferRoute & Quant.ai
Browse files- README.md +2 -1
- external/Quant.ai/frontend/src/config.ts +5 -5
- external/Quant.ai/index.html +1 -1
- quant.html +1 -1
- quant/index.html +1 -1
- scratch/deploy_inferroute_space.py +1 -1
README.md
CHANGED
|
@@ -3,7 +3,8 @@ title: InferRoute Multi-LLM Gateway
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
|
|
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
external/Quant.ai/frontend/src/config.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
// frontend/src/config.ts
|
| 2 |
// Automatically resolves backend API URL for local dev, Docker container, or deployed HF Space
|
| 3 |
|
| 4 |
-
let defaultApiBase = '
|
| 5 |
|
| 6 |
if (typeof window !== 'undefined') {
|
| 7 |
-
if (window.location.port === '5173' || window.location.port === '3000'
|
| 8 |
defaultApiBase = 'http://127.0.0.1:8000';
|
| 9 |
} else {
|
| 10 |
-
// When
|
| 11 |
-
defaultApiBase =
|
| 12 |
}
|
| 13 |
}
|
| 14 |
|
| 15 |
-
export const API_BASE = (import.meta.env?.VITE_API_BASE as string) ||
|
| 16 |
|
|
|
|
| 1 |
// frontend/src/config.ts
|
| 2 |
// Automatically resolves backend API URL for local dev, Docker container, or deployed HF Space
|
| 3 |
|
| 4 |
+
let defaultApiBase = 'http://127.0.0.1:8000';
|
| 5 |
|
| 6 |
if (typeof window !== 'undefined') {
|
| 7 |
+
if (window.location.port === '5173' || window.location.port === '3000') {
|
| 8 |
defaultApiBase = 'http://127.0.0.1:8000';
|
| 9 |
} else {
|
| 10 |
+
// When served via FastAPI server or hosted Docker Space
|
| 11 |
+
defaultApiBase = window.location.origin;
|
| 12 |
}
|
| 13 |
}
|
| 14 |
|
| 15 |
+
export const API_BASE = (import.meta.env?.VITE_API_BASE as string) || defaultApiBase;
|
| 16 |
|
external/Quant.ai/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>frontend</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>frontend</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-C6qvxrC6.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
quant.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>frontend</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>frontend</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-C6qvxrC6.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
quant/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Quant.ai Trading Terminal</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Quant.ai Trading Terminal</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-C6qvxrC6.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-DCSOhC_L.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
scratch/deploy_inferroute_space.py
CHANGED
|
@@ -10,7 +10,7 @@ try:
|
|
| 10 |
url = create_repo(
|
| 11 |
repo_id=repo_id,
|
| 12 |
repo_type="space",
|
| 13 |
-
space_sdk="
|
| 14 |
private=False,
|
| 15 |
exist_ok=True
|
| 16 |
)
|
|
|
|
| 10 |
url = create_repo(
|
| 11 |
repo_id=repo_id,
|
| 12 |
repo_type="space",
|
| 13 |
+
space_sdk="docker",
|
| 14 |
private=False,
|
| 15 |
exist_ok=True
|
| 16 |
)
|