Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +1 -1
- frontend/src/components/RunWithLlmPane.tsx +5 -2
- frontend/src/lib/llmPresets.ts +72 -43
Dockerfile
CHANGED
|
@@ -38,7 +38,7 @@ COPY frontend/ ./
|
|
| 38 |
ENV VITE_PHYSIX_API_URL=""
|
| 39 |
# Cache-bust marker. Bump when an SPA change isn't taking on the Space —
|
| 40 |
# HF BuildKit occasionally reuses stage-1 output even when sources changed.
|
| 41 |
-
# physix-spa-rebuild:
|
| 42 |
RUN pnpm exec tsc -b \
|
| 43 |
&& pnpm exec vite build --base=/web/
|
| 44 |
|
|
|
|
| 38 |
ENV VITE_PHYSIX_API_URL=""
|
| 39 |
# Cache-bust marker. Bump when an SPA change isn't taking on the Space —
|
| 40 |
# HF BuildKit occasionally reuses stage-1 output even when sources changed.
|
| 41 |
+
# physix-spa-rebuild: 5
|
| 42 |
RUN pnpm exec tsc -b \
|
| 43 |
&& pnpm exec vite build --base=/web/
|
| 44 |
|
frontend/src/components/RunWithLlmPane.tsx
CHANGED
|
@@ -20,7 +20,10 @@ import {
|
|
| 20 |
useLlmEpisodeRunner,
|
| 21 |
} from "@/hooks/useLlmEpisodeRunner";
|
| 22 |
import { cn } from "@/lib/cn";
|
| 23 |
-
import {
|
|
|
|
|
|
|
|
|
|
| 24 |
import { pickPrimaryVariable } from "@/lib/trajectory";
|
| 25 |
import type { RewardBreakdown } from "@/types/physix";
|
| 26 |
|
|
@@ -40,7 +43,7 @@ export function RunWithLlmPane(): JSX.Element {
|
|
| 40 |
const runner = useLlmEpisodeRunner();
|
| 41 |
|
| 42 |
const [connection, setConnection] = useState<LlmConnection>(
|
| 43 |
-
() =>
|
| 44 |
);
|
| 45 |
const [systemId, setSystemId] = useState<string>("");
|
| 46 |
const [maxTurns, setMaxTurns] = useState<number>(8);
|
|
|
|
| 20 |
useLlmEpisodeRunner,
|
| 21 |
} from "@/hooks/useLlmEpisodeRunner";
|
| 22 |
import { cn } from "@/lib/cn";
|
| 23 |
+
import {
|
| 24 |
+
DEFAULT_SINGLE_LLM_CONNECTION,
|
| 25 |
+
type LlmConnection,
|
| 26 |
+
} from "@/lib/llmPresets";
|
| 27 |
import { pickPrimaryVariable } from "@/lib/trajectory";
|
| 28 |
import type { RewardBreakdown } from "@/types/physix";
|
| 29 |
|
|
|
|
| 43 |
const runner = useLlmEpisodeRunner();
|
| 44 |
|
| 45 |
const [connection, setConnection] = useState<LlmConnection>(
|
| 46 |
+
() => DEFAULT_SINGLE_LLM_CONNECTION,
|
| 47 |
);
|
| 48 |
const [systemId, setSystemId] = useState<string>("");
|
| 49 |
const [maxTurns, setMaxTurns] = useState<number>(8);
|
frontend/src/lib/llmPresets.ts
CHANGED
|
@@ -60,7 +60,50 @@ export interface Endpoint {
|
|
| 60 |
hint: string;
|
| 61 |
}
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
export const ENDPOINTS: readonly Endpoint[] = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
{
|
| 65 |
id: "physix",
|
| 66 |
label: "PhysiX-Infer GPU ✦",
|
|
@@ -97,43 +140,6 @@ export const ENDPOINTS: readonly Endpoint[] = [
|
|
| 97 |
],
|
| 98 |
hint: "Local dev. Requires `ollama serve` running on this machine.",
|
| 99 |
},
|
| 100 |
-
{
|
| 101 |
-
id: "hf",
|
| 102 |
-
label: "Hugging Face Router",
|
| 103 |
-
baseUrl: HF_ROUTER_BASE_URL,
|
| 104 |
-
needsKey: true,
|
| 105 |
-
modelInputMode: "freeform-with-suggestions",
|
| 106 |
-
// Suggestions limited to models we've live-probed against the HF
|
| 107 |
-
// Router and confirmed serve through at least one provider. The
|
| 108 |
-
// first entry is the default the form prefills — keep it
|
| 109 |
-
// small-and-fast so the first turn doesn't feel like it stalled.
|
| 110 |
-
//
|
| 111 |
-
// Notable absentee: Qwen/Qwen2.5-3B-Instruct (the base of
|
| 112 |
-
// physix-3b-rl). It's the natural baseline to compare against the
|
| 113 |
-
// trained model, but as of Apr 2026 NO router provider serves it,
|
| 114 |
-
// so prefilling it would 400 every fresh user. We ship that model
|
| 115 |
-
// via the "PhysiX-Infer GPU" endpoint above instead — that's where
|
| 116 |
-
// the apples-to-apples comparison happens.
|
| 117 |
-
//
|
| 118 |
-
// Custom fine-tunes (incl. Pratyush-01/physix-3b-rl) are also NOT
|
| 119 |
-
// in this list — the router only dispatches to provider-hosted
|
| 120 |
-
// models. Use the "PhysiX-Infer GPU" endpoint above (free, hosts
|
| 121 |
-
// both checkpoints) or a Custom inference endpoint URL.
|
| 122 |
-
modelSuggestions: [
|
| 123 |
-
{ id: "Qwen/Qwen2.5-7B-Instruct", tag: "fast baseline" },
|
| 124 |
-
{ id: "Qwen/Qwen2.5-72B-Instruct", tag: "large baseline" },
|
| 125 |
-
{ id: "Qwen/Qwen2.5-Coder-32B-Instruct", tag: "coder" },
|
| 126 |
-
{ id: "meta-llama/Llama-3.3-70B-Instruct", tag: "llama" },
|
| 127 |
-
{ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", tag: "reasoning" },
|
| 128 |
-
],
|
| 129 |
-
hint:
|
| 130 |
-
"Routed through https://router.huggingface.co/v1. Needs an HF token " +
|
| 131 |
-
"with 'Make calls to Inference Providers' permission. Note: not every " +
|
| 132 |
-
"HF model is router-served — pick from the suggestions or check the " +
|
| 133 |
-
"model card's 'Inference Providers' panel before pasting an id. " +
|
| 134 |
-
"To run your own fine-tune here, deploy it via 'Deploy → Inference " +
|
| 135 |
-
"Endpoints' first; otherwise use Ollama or a custom vLLM URL.",
|
| 136 |
-
},
|
| 137 |
{
|
| 138 |
id: "openai",
|
| 139 |
label: "OpenAI",
|
|
@@ -180,8 +186,30 @@ export interface LlmConnection {
|
|
| 180 |
apiKey: string;
|
| 181 |
}
|
| 182 |
|
| 183 |
-
/** Default
|
| 184 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
export const DEFAULT_CONNECTION_A: LlmConnection = {
|
| 186 |
endpointId: "physix",
|
| 187 |
baseUrl: PHYSIX_INFER_BASE_URL,
|
|
@@ -189,10 +217,11 @@ export const DEFAULT_CONNECTION_A: LlmConnection = {
|
|
| 189 |
apiKey: "",
|
| 190 |
};
|
| 191 |
|
| 192 |
-
/** Default B side: same sister Space, same L4 GPU,
|
| 193 |
-
* 3B baseline. Apples-to-apples — identical
|
| 194 |
-
* hardware, identical generation params; only
|
| 195 |
-
* Both models share the same Space, so warming
|
|
|
|
| 196 |
export const DEFAULT_CONNECTION_B: LlmConnection = {
|
| 197 |
endpointId: "physix",
|
| 198 |
baseUrl: PHYSIX_INFER_BASE_URL,
|
|
|
|
| 60 |
hint: string;
|
| 61 |
}
|
| 62 |
|
| 63 |
+
// Order matters: the FIRST entry is what the dropdown prefills on a
|
| 64 |
+
// fresh page-load (and what `findEndpoint` falls back to for a stale
|
| 65 |
+
// localStorage id). HF Router is first because it's the lowest-friction
|
| 66 |
+
// "bring your own token" path — it answers in <2 s once a token is
|
| 67 |
+
// pasted, no GPU cold-start. The PhysiX-Infer entry is second so it's
|
| 68 |
+
// still one click away for the "compare trained vs base" workflow.
|
| 69 |
export const ENDPOINTS: readonly Endpoint[] = [
|
| 70 |
+
{
|
| 71 |
+
id: "hf",
|
| 72 |
+
label: "Hugging Face Router",
|
| 73 |
+
baseUrl: HF_ROUTER_BASE_URL,
|
| 74 |
+
needsKey: true,
|
| 75 |
+
modelInputMode: "freeform-with-suggestions",
|
| 76 |
+
// Suggestions limited to models we've live-probed against the HF
|
| 77 |
+
// Router and confirmed serve through at least one provider. The
|
| 78 |
+
// first entry is the default the form prefills — keep it
|
| 79 |
+
// small-and-fast so the first turn doesn't feel like it stalled.
|
| 80 |
+
//
|
| 81 |
+
// Notable absentee: Qwen/Qwen2.5-3B-Instruct (the base of
|
| 82 |
+
// physix-3b-rl). It's the natural baseline to compare against the
|
| 83 |
+
// trained model, but as of Apr 2026 NO router provider serves it,
|
| 84 |
+
// so prefilling it would 400 every fresh user. We ship that model
|
| 85 |
+
// via the "PhysiX-Infer GPU" endpoint instead — that's where the
|
| 86 |
+
// apples-to-apples comparison happens.
|
| 87 |
+
//
|
| 88 |
+
// Custom fine-tunes (incl. Pratyush-01/physix-3b-rl) are also NOT
|
| 89 |
+
// in this list — the router only dispatches to provider-hosted
|
| 90 |
+
// models. Use the "PhysiX-Infer GPU" endpoint (free, hosts both
|
| 91 |
+
// checkpoints) or a Custom inference endpoint URL.
|
| 92 |
+
modelSuggestions: [
|
| 93 |
+
{ id: "Qwen/Qwen2.5-7B-Instruct", tag: "fast baseline" },
|
| 94 |
+
{ id: "Qwen/Qwen2.5-72B-Instruct", tag: "large baseline" },
|
| 95 |
+
{ id: "Qwen/Qwen2.5-Coder-32B-Instruct", tag: "coder" },
|
| 96 |
+
{ id: "meta-llama/Llama-3.3-70B-Instruct", tag: "llama" },
|
| 97 |
+
{ id: "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", tag: "reasoning" },
|
| 98 |
+
],
|
| 99 |
+
hint:
|
| 100 |
+
"Routed through https://router.huggingface.co/v1. Needs an HF token " +
|
| 101 |
+
"with 'Make calls to Inference Providers' permission. Note: not every " +
|
| 102 |
+
"HF model is router-served — pick from the suggestions or check the " +
|
| 103 |
+
"model card's 'Inference Providers' panel before pasting an id. " +
|
| 104 |
+
"To run your own fine-tune here, deploy it via 'Deploy → Inference " +
|
| 105 |
+
"Endpoints' first; otherwise use the PhysiX-Infer GPU endpoint.",
|
| 106 |
+
},
|
| 107 |
{
|
| 108 |
id: "physix",
|
| 109 |
label: "PhysiX-Infer GPU ✦",
|
|
|
|
| 140 |
],
|
| 141 |
hint: "Local dev. Requires `ollama serve` running on this machine.",
|
| 142 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
{
|
| 144 |
id: "openai",
|
| 145 |
label: "OpenAI",
|
|
|
|
| 186 |
apiKey: string;
|
| 187 |
}
|
| 188 |
|
| 189 |
+
/** Default for the single-LLM "Run with LLM" pane.
|
| 190 |
+
*
|
| 191 |
+
* HF Router is the lowest-friction option for a first-time visitor:
|
| 192 |
+
* paste a token, pick a suggested model (all live-probed and known to
|
| 193 |
+
* serve), get a response in ~2 s. No GPU cold-start, no localhost
|
| 194 |
+
* dependency.
|
| 195 |
+
*
|
| 196 |
+
* We prefill the model so the Run button is enabled the moment the
|
| 197 |
+
* user pastes a token — keeping the model empty and forcing them to
|
| 198 |
+
* pick from the dropdown is friction we don't need. The api key
|
| 199 |
+
* field is hydrated from localStorage by the panel on first render. */
|
| 200 |
+
export const DEFAULT_SINGLE_LLM_CONNECTION: LlmConnection = {
|
| 201 |
+
endpointId: "hf",
|
| 202 |
+
baseUrl: HF_ROUTER_BASE_URL,
|
| 203 |
+
// Matches the first entry of the "hf" endpoint's modelSuggestions —
|
| 204 |
+
// smallest router-served Qwen model, fastest response.
|
| 205 |
+
model: "Qwen/Qwen2.5-7B-Instruct",
|
| 206 |
+
apiKey: "",
|
| 207 |
+
};
|
| 208 |
+
|
| 209 |
+
/** Default A side of the Compare pane: trained PhysiX-3B on the sister
|
| 210 |
+
* GPU Space. The Compare pane's whole purpose is the trained-vs-base
|
| 211 |
+
* side-by-side, so it's worth the cold-start penalty here even though
|
| 212 |
+
* the single-LLM pane avoids it. No token needed. */
|
| 213 |
export const DEFAULT_CONNECTION_A: LlmConnection = {
|
| 214 |
endpointId: "physix",
|
| 215 |
baseUrl: PHYSIX_INFER_BASE_URL,
|
|
|
|
| 217 |
apiKey: "",
|
| 218 |
};
|
| 219 |
|
| 220 |
+
/** Default B side of the Compare pane: same sister Space, same L4 GPU,
|
| 221 |
+
* just the Qwen 2.5 3B baseline. Apples-to-apples — identical
|
| 222 |
+
* architecture, identical hardware, identical generation params; only
|
| 223 |
+
* the weights differ. Both models share the same Space, so warming
|
| 224 |
+
* side A also warms B. */
|
| 225 |
export const DEFAULT_CONNECTION_B: LlmConnection = {
|
| 226 |
endpointId: "physix",
|
| 227 |
baseUrl: PHYSIX_INFER_BASE_URL,
|