ausername-12345 commited on
Commit ·
3ee7765
1
Parent(s): c1483d6
fix default model to 'lightning' for InferencePort API compatibility
Browse files- .env.example +3 -2
- src/inferenceClient.js +4 -6
.env.example
CHANGED
|
@@ -8,8 +8,9 @@ INFERENCE_API_URL=https://sharktide-lightning.hf.space/v1/chat/completions
|
|
| 8 |
# Secret - set this in Space secrets, not in the repo.
|
| 9 |
INFERENCE_API_KEY=
|
| 10 |
|
| 11 |
-
# Model id served by that endpoint.
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
# Optional: name Forge uses for itself in the UI and its own system prompt.
|
| 15 |
AGENT_NAME=Forge
|
|
|
|
| 8 |
# Secret - set this in Space secrets, not in the repo.
|
| 9 |
INFERENCE_API_KEY=
|
| 10 |
|
| 11 |
+
# Model id served by that endpoint. 'lightning' is the auto-router (recommended).
|
| 12 |
+
# Override models can be configured in the InferencePort console.
|
| 13 |
+
INFERENCE_MODEL=lightning
|
| 14 |
|
| 15 |
# Optional: name Forge uses for itself in the UI and its own system prompt.
|
| 16 |
AGENT_NAME=Forge
|
src/inferenceClient.js
CHANGED
|
@@ -2,17 +2,15 @@ const API_URL = process.env.INFERENCE_API_URL;
|
|
| 2 |
const API_KEY = process.env.INFERENCE_API_KEY;
|
| 3 |
const FETCH_TIMEOUT = 30000;
|
| 4 |
|
| 5 |
-
let currentModel = process.env.INFERENCE_MODEL || '
|
| 6 |
|
| 7 |
const AVAILABLE_MODELS = [
|
|
|
|
|
|
|
|
|
|
| 8 |
'llama-3.3-70b-versatile',
|
| 9 |
'llama-3.1-8b-instant',
|
| 10 |
-
'llama3-70b-8192',
|
| 11 |
-
'llama3-8b-8192',
|
| 12 |
-
'mixtral-8x7b-32768',
|
| 13 |
'gemma2-9b-it',
|
| 14 |
-
'gpt-4o-mini',
|
| 15 |
-
'claude-sonnet-4-20250514',
|
| 16 |
];
|
| 17 |
|
| 18 |
function getModel() { return currentModel; }
|
|
|
|
| 2 |
const API_KEY = process.env.INFERENCE_API_KEY;
|
| 3 |
const FETCH_TIMEOUT = 30000;
|
| 4 |
|
| 5 |
+
let currentModel = process.env.INFERENCE_MODEL || 'lightning';
|
| 6 |
|
| 7 |
const AVAILABLE_MODELS = [
|
| 8 |
+
'lightning',
|
| 9 |
+
'gpt-4o-mini',
|
| 10 |
+
'claude-sonnet-4-20250514',
|
| 11 |
'llama-3.3-70b-versatile',
|
| 12 |
'llama-3.1-8b-instant',
|
|
|
|
|
|
|
|
|
|
| 13 |
'gemma2-9b-it',
|
|
|
|
|
|
|
| 14 |
];
|
| 15 |
|
| 16 |
function getModel() { return currentModel; }
|