Skip to content

Commit 09ec108

Browse files
committed
Switch model URLs from GitHub Releases to raw.githubusercontent.com
GitHub Releases don't serve CORS headers, so browser fetch() fails under COEP. raw.githubusercontent.com serves both: - Access-Control-Allow-Origin: * - Cross-Origin-Resource-Policy: cross-origin Model files are hosted on the orphan `models` branch and served via: https://raw.githubusercontent.com/CSSLab/maia-platform-frontend/models/ https://claude.ai/code/session_01T73Yphu4y2U3c3ctCcHVPf
1 parent c7ec319 commit 09ec108

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/contexts/MaiaEngineContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const MaiaEngineContextProvider: React.FC<{ children: ReactNode }> = ({
3333
const model = new Maia({
3434
model:
3535
process.env.NEXT_PUBLIC_MAIA_MODEL_URL ??
36-
'https://github.com/CSSLab/maia-platform-frontend/releases/download/models-v1/maia_rapid.onnx',
36+
'https://raw.githubusercontent.com/CSSLab/maia-platform-frontend/models/maia2/maia_rapid.onnx',
3737
setStatus: setStatus,
3838
setProgress: setProgress,
3939
setError: setError,

src/lib/engine/stockfish.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,12 @@ const setupStockfish = (): Promise<StockfishWeb> => {
350350
locateFile: (name: string) => `/stockfish/${name}`,
351351
})
352352
.then(async (instance: StockfishWeb) => {
353-
// NNUE weights are hosted on GitHub Releases to avoid Vercel bandwidth costs.
353+
// NNUE weights are hosted on a separate branch and served via
354+
// raw.githubusercontent.com (CORS + COEP compatible).
354355
// Override with NEXT_PUBLIC_STOCKFISH_NNUE_BASE_URL for self-hosted deployments.
355356
const nnueBaseUrl =
356357
process.env.NEXT_PUBLIC_STOCKFISH_NNUE_BASE_URL ??
357-
'https://github.com/CSSLab/maia-platform-frontend/releases/download/models-v1'
358+
'https://raw.githubusercontent.com/CSSLab/maia-platform-frontend/models/stockfish'
358359
// Load NNUE models before resolving
359360
Promise.all([
360361
fetch(`${nnueBaseUrl}/${instance.getRecommendedNnue(0)}`),

0 commit comments

Comments
 (0)