feat(ide): add webllm model download script, dockerfile stage, ci cac… · modelscript/modelscript@2248988 · GitHub
Skip to content

Commit 2248988

Browse files
committed
feat(ide): add webllm model download script, dockerfile stage, ci caching, and readme docs
1 parent c407187 commit 2248988

5 files changed

Lines changed: 93 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 0 deletions

‎Dockerfile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ EXPOSE 80
119119
# ==============================================================================
120120
# IDE
121121
# ==============================================================================
122+
123+
# Download WebLLM model weights (cached layer)
124+
FROM node:22-alpine AS download-model
125+
RUN apk add --no-cache curl bash
126+
WORKDIR /models
127+
COPY packages/ide/scripts/download-model.sh /tmp/download-model.sh
128+
RUN bash /tmp/download-model.sh /models
129+
122130
FROM deps AS build-ide-false
123131
COPY scripts scripts
124132
COPY packages/core packages/core
@@ -164,6 +172,7 @@ COPY --from=build-ide /app/packages/vscode/syntaxes packages/vscode/syntaxes
164172
COPY --from=build-ide /app/packages/vscode/language-configuration.json packages/vscode/
165173
COPY --from=build-ide /app/packages/morsel/public packages/morsel/public
166174
COPY --from=build-ide /app/node_modules/@vscode node_modules/@vscode
175+
COPY --from=download-model /models packages/ide/models
167176
EXPOSE 3200
168177
ENV NODE_ENV=production
169178
ENV PORT=3200

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ This launches:
9292
| API | http://localhost:3000 | REST API for simulation, publishing, queries |
9393
| IDE (VS Code Web) | http://localhost:3200 | Browser-based VS Code with Modelica support |
9494

95+
#### AI Chat (Optional)
96+
97+
The IDE includes a browser-local AI assistant powered by WebLLM (Qwen3-0.6B). To enable it, download the model weights (~350 MB, one-time):
98+
99+
```bash
100+
npm run download-model --workspace=@modelscript/ide
101+
```
102+
103+
Once downloaded, restart `npm run dev` and open the **ModelScript AI** panel in the IDE sidebar.
104+
95105
### CLI Usage
96106

97107
After building, the CLI is available as `msc`:

‎packages/ide/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"build-server": "npx esbuild src/server.ts --bundle --platform=node --format=esm --outfile=dist/server.js --external:express --external:http-proxy-middleware",
1111
"build-static": "npm run download-vscode && npm run build-github-fs && npx tsx src/build-static.ts",
1212
"dev": "npm run download-vscode && npx tsx src/server.ts",
13+
"download-model": "bash scripts/download-model.sh",
1314
"download-vscode": "npx tsx src/download-vscode.ts",
1415
"lint": "eslint src --ext ts"
1516
},
Lines changed: 61 additions & 0 deletions

0 commit comments

Comments
 (0)