Running Context Engineering locally
Use this page to run the extracted summarization challenge on your computer. You install its locked packages, adapt two Scrimba-only environment reads for Vite, and connect the browser project to OpenRouter. The general running course projects locally guide covers the shared Node and npm setup in more detail.
What you need first
Install a supported LTS version of Node.js. Node 24 is recommended and includes npm.
Check that both commands work:
$ node --version
v24.18.0
$ npm --version
11.18.0If either command says "command not found," finish installing Node before you continue.
You also need an OpenRouter API key and a model ID available to your account. Use a temporary key with a low spending limit because this learning project runs provider requests in the browser.
node --version and npm --version print numbers before you go on. Then prepare a temporary OpenRouter key with a low spending limit. I once spent an afternoon debugging a project when the real problem was that Node never finished installing, so those two checks are worth the ten seconds! Open and install the project
Open a terminal in the extracted folder containing package.json, then install the locked packages:
$ cd path-to-your-downloaded-project
$ npm ciKeep the included lockfile. If npm reports audit findings, do not run npm audit fix --force without checking what it changes; that command can move course dependencies across major versions.
npm ci in the extracted folder, the one with package.json in it. Do not change the lockfile: it lists the exact package versions the course was recorded against. Repair the environment variables
Search main.js and utils.js for these values:
process.env.OPENROUTER_KEY
process.env.MODEL_IDReplace every occurrence with:
import.meta.env.VITE_OPENROUTER_KEY
import.meta.env.VITE_MODEL_IDCreate .env beside package.json:
VITE_OPENROUTER_KEY=your-openrouter-key
VITE_MODEL_ID=a-current-model-id-from-openrouterVite reads .env at startup; restart the dev server after editing it.
Use a model that is currently available to your OpenRouter account and supports the calls made in the course. Provider catalogs can change.
Create .gitignore:
.env
node_modules/
dist/The Git handbook covers this habit in ignoring files and good habits.
The OpenRouter key is browser-visible
Every VITE_ value is included in client code. Use a temporary learning key, set a low spending limit, and do not publish this project. A deployed version must call the provider from a backend.
process.env reads with the matching VITE_ names, create .env, and restart the dev server after editing the file. And use a temporary OpenRouter key here: this browser project shows the key to anyone who looks, which surprised me the first time too. Run and check the project
$ npm startOpen the Local URL printed by Vite and continue the conversation until the project summarizes its earlier messages. A new summary in the running app is the visible success result. Vite usually restarts itself when .env changes; if the new value does not take effect, stop the server with Ctrl+C and start it again.
npm start, open the Local URL Vite prints, and chat until the app summarizes its earlier messages. That summary appearing is your proof the OpenRouter setup works. Ctrl+C stops the server when you are done. Troubleshooting
process is not defined: At least one environment read remains in main.js or utils.js. Search both files, not only the Vite configuration.
The model returns 404 or an access error: Read the OpenRouter error body: a 401 points to the key, a 404 to the model ID, and a 429 to a rate limit. Copy a current model ID from OpenRouter and confirm that the account can use it.
The conversation works until it becomes long: That is the behavior this course explores. Confirm that your edits did not change the token thresholds, the summary prompts, or the sample conversation data the course ships before diagnosing the provider.
The key remains undefined: Confirm the VITE_ spelling, place .env beside package.json, and restart Vite.
process.env reads, then check the two VITE_ spellings in .env. Most errors here are one stray character, which I know from finding mine on the fourth read. And a long conversation triggering a summary is the course working, not breaking. 
