Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ yarn-error.log*

# typescript
*.tsbuildinfo

# Large model weights - hosted on GitHub Releases, not committed to the repo
/public/maia2/*.onnx
/public/stockfish/*.nnue
Binary file removed public/maia2/maia_rapid.onnx
Binary file not shown.
Binary file removed public/stockfish/nn-1111cefa1111.nnue
Binary file not shown.
Binary file removed public/stockfish/nn-37f18f62d772.nnue
Binary file not shown.
4 changes: 3 additions & 1 deletion src/contexts/MaiaEngineContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export const MaiaEngineContextProvider: React.FC<{ children: ReactNode }> = ({

const maia = useMemo(() => {
const model = new Maia({
model: '/maia2/maia_rapid.onnx',
model:
process.env.NEXT_PUBLIC_MAIA_MODEL_URL ??
'https://raw.githubusercontent.com/CSSLab/maia-platform-frontend/e23a50e/public/maia2/maia_rapid.onnx',
setStatus: setStatus,
setProgress: setProgress,
setError: setError,
Expand Down
9 changes: 7 additions & 2 deletions src/lib/engine/stockfish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,15 @@ const setupStockfish = (): Promise<StockfishWeb> => {
locateFile: (name: string) => `/stockfish/${name}`,
})
.then(async (instance: StockfishWeb) => {
// NNUE weights served via raw.githubusercontent.com permalink (CORS + COEP compatible).
// Override with NEXT_PUBLIC_STOCKFISH_NNUE_BASE_URL for self-hosted deployments.
const nnueBaseUrl =
process.env.NEXT_PUBLIC_STOCKFISH_NNUE_BASE_URL ??
'https://raw.githubusercontent.com/CSSLab/maia-platform-frontend/e23a50e/public/stockfish'
// Load NNUE models before resolving
Promise.all([
fetch(`/stockfish/${instance.getRecommendedNnue(0)}`),
fetch(`/stockfish/${instance.getRecommendedNnue(1)}`),
fetch(`${nnueBaseUrl}/${instance.getRecommendedNnue(0)}`),
fetch(`${nnueBaseUrl}/${instance.getRecommendedNnue(1)}`),
])
.then((responses) => {
return Promise.all([
Expand Down
Loading