Ypeng12 commited on
Commit
fdb27f4
·
1 Parent(s): f920d23

Clean native Docker deployment setup for InferRoute & Quant.ai

Browse files
README.md CHANGED
@@ -3,7 +3,8 @@ title: InferRoute Multi-LLM Gateway
3
  emoji: 🚀
4
  colorFrom: blue
5
  colorTo: indigo
6
- sdk: static
 
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 = 'https://inferroute-977n.onrender.com';
5
 
6
  if (typeof window !== 'undefined') {
7
- if (window.location.port === '5173' || window.location.port === '3000' || window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
8
  defaultApiBase = 'http://127.0.0.1:8000';
9
  } else {
10
- // When hosted on Static HF Space or served via cloud FastAPI
11
- defaultApiBase = 'https://inferroute-977n.onrender.com';
12
  }
13
  }
14
 
15
- export const API_BASE = (import.meta.env?.VITE_API_BASE as string) || (typeof window !== 'undefined' && localStorage.getItem('API_BASE')) || defaultApiBase;
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-BkbK-1SD.js"></script>
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-BkbK-1SD.js"></script>
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-BkbK-1SD.js"></script>
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="static",
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
  )