Session 5 · Friday, August 28, 2026

Other Models and Private Data

Today we combine these five days into one small build and also discuss what to do after the course, and if a section has an activity, it shows in the panel on the right.

Opening

Today

  • Today's goal is to combine these five days into one small build and we will also cover what to do after the course.
  • Here is the plan for the day:
Turn your analysis into a website
Build your results page (100 minutes)
Other models in this agent
A pure local model, for private data
Show your project
Wrap-up

Turn your analysis into a website · do it on the right

Definition of building

  • You can run an analysis and nobody else can use it.
  • Today, building means one specific thing: turning your analysis into a webpage that other people can open and read.
  • The page shows your question, one figure or table from output/, and one sentence saying what you found.
  • The division of labor is the same as Monday. You specify and verify, and the agent writes the code.

How a web page works

  • Every webpage, from a personal site to a results page, has three layers:
    • what the reader sees, which is the structure, the style, and the behavior
    • What changes on the page and which are the inputs and filters?
    • The numbers come from your analysis output.
  • You will let the agent write all of these layers.
  • Learn the layers, which lets you check the agent's work. Open the page, click through it, and verify the numbers against your output.
Live demo

The demo case is this website

  • The site you are reading right now was built this way. I described the layout and the content, and the agent wrote every line of the HTML.
  • Each session page is one plain HTML file in the course repository. There is no server and no framework. A folder of files becomes a website.
  • We open the file for this page next to the page itself, and change one thing: ask the agent to edit one card, reload, and see the change.
  • Your build this morning is a smaller version of the same thing: one HTML file that shows your own results.

Other models in this agent · do it on the right

Claude Code and the model under it are two things

  • Claude Code is the tool you type into. The model that answers is separate. Both can be swapped.
  • The tool: Claude Code is not the only one.
    • each model company ships its own — Claude Code (Anthropic), Codex (OpenAI), Gemini CLI (Google)
    • open-source tools belong to no company and take any model — for example OpenCode
  • The model: it can sit in three places:
    • Anthropic’s computers — the default. The model is Claude.
    • Another company’s API — still over the internet, but much cheaper.
    • A pure local model — served by Ollama on a machine you control. Your data never goes to any company.
  • Why would you want a model other than Claude?
    • cheaper — open models sell for a fraction of the price
    • verification — a second model checks Claude’s work, because models from the same company make the same mistakes
    • private data — some data cannot be sent to any company, so the model must run where the data is
  • The next card covers the cheap route. The verification command is built on the right. The next section covers the pure local model.

Another company’s API

  • OpenRouter is the easy version: one account, one key, hundreds of models (DeepSeek, Kimi, Qwen, and Claude itself) behind one address.
  • Claude Code points at it with three lines:
    • ANTHROPIC_BASE_URL=https://openrouter.ai/api
    • your OpenRouter key as ANTHROPIC_AUTH_TOKEN
    • ANTHROPIC_MODEL set to any name from openrouter.ai/models
  • You can also skip the middleman: DeepSeek, Kimi, and GLM each sell their own Anthropic-protocol API — same three lines, that company’s address and key. (OpenAI is the exception: GPT is not reachable this way; use Codex for GPT.)
  • Cheaper is not private: your data still leaves your machine, now to a different company’s servers.

A pure local model, for private data · do it on the right

When your data cannot leave

  • Some data cannot go to any company’s server: human subjects, restricted records, anything under an IRB or a data agreement.
  • Every route so far sends your files to someone’s server.
  • Two fixes, in order of effort:
    • keep Claude, and hide the data from the agent (next card)
    • run an open model on a machine you control, so your data never leaves that machine (the rest of this section)
  • That machine is usually your laptop. When the laptop cannot cope, Brown’s Oscar cluster works too — last card of this section.

Half-way: keep Claude, hide the data

  • Your data file and your codebook are two different files. The data holds the rows. The codebook is the document that lists each variable’s name and meaning — every survey ships one, or you write a page yourself.
  • The agent only needs the codebook. It writes the script from the codebook, and the script reads the real data when it runs — the agent never does.
  • The simplest way to hide the data: keep it outside the project folder, and let the script point to it by path. The agent works inside the project, and a file it cannot see is a file it cannot quote.
  • If you want a lock on top: a deny rule in .claude/settings.json"permissions": {"deny": ["Read(/path/to/data/**)"]}. Then even an accidental “yes” to a read request cannot open the file.
  • The leak to watch: error messages and printed output can quote data values into the conversation. Keep prints to counts and coefficients.

What Ollama is

  • Ollama is a free program that downloads and serves open models: pull a model by name, one interface for all of them.
  • Its trick: it imitates a company’s API. It answers the exact same calls, at an address on your own machine, with no internet involved. The tool you type into cannot tell the difference.
  • Do not accept its default model — 7–10 GB, most laptops cannot run it. Course default: qwen3:4b (2.5 GB).

Ollama + Claude Code

  • Type ollama and pick Claude Code and your model from the menu, or do the same in the Ollama app. Official guide: docs.ollama.com/integrations/claude-code. For Codex: codex --oss.
  • One issue remains: Claude Code is still Anthropic’s program. By default it sends usage metrics and error reports to Anthropic — never your prompts, data, or files. Run it with CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 to turn that off.
  • Check it yourself: pick a model that runs locally (not one marked cloud), turn off your wifi, and give it a task. If it still works, nothing was going out — proof you can show an IRB.

Ollama + OpenCode

  • For the absolute version, swap the tool too: OpenCode is open-source, needs no account, and belongs to no company. With Ollama under it, no part of the stack can send anything anywhere.
  • This is the pairing for a real project on sensitive data — and serious models want a bigger machine: a 32 GB laptop, or Oscar (two cards down).

Most laptops struggle with this

  • A model that can drive an agent is a heavy program, and most laptops are at the edge:
    • under 4B parameters: cannot follow the agent’s tool instructions at all
    • 4B (our course default): completes the exercise, slowly
    • comfortable starts around 20B — and that needs a 32 GB machine
  • The context window is a second memory cost on top of the model. The same 2.5 GB model needs:
    • 4.8 GB of memory at 16k context
    • 7.8 GB at 32k
  • And the default context is too small for an agent: laptops default to 4k tokens, while the agent’s own instructions are ~20k. The instructions get cut off with no error message. Set the context to 32k in the Ollama app settings.

When your laptop is not enough: Brown’s Oscar

  • Oscar is Brown’s computing cluster. A GPU node there runs models far beyond any laptop, and your data stays inside Brown’s systems.
  • CCV maintains Ollama on Oscar, with a shared library of already-downloaded models: docs.ccv.brown.edu/oscar/large-language-models.
  • The recipe from that page:
    • interact -n 4 -m 32g -q gpu -g 1 — get a GPU node
    • module load ollama, then ollama serve
    • second terminal: ssh to the node and ollama run a model
  • Working on Oscar means working over ssh, in a terminal — there is no other interface. This is where Monday’s terminal skills pay off: on a cluster, the terminal is all there is.
  • The agent CCV documents there is OpenCode — open-source, no account needed, and it takes the Ollama on the node as its model. The whole stack runs inside Brown’s systems.

Show your project

Show your project

  • Tell us in a few minutes what you made this week. A finished project is not required.
  • If you have a complete project, walk us through it: the question, the analysis, the figure or the website.
  • If not, show any piece: a data analysis, a visualization, a workflow or Skill you customized, anything you built around the agent.
  • If the agent got something wrong and you caught it, tell that story — it is the most useful thing to share.

Wrap-up

What we covered

  • Monday: getting started — the terminal, a project repository, your first analysis with the agent.
  • Tuesday: working in stages — plans you approve before the agent runs, checking results, git for version control, subagents for parallel work.
  • Wednesday: project instruction files and Skills.
  • Thursday: connecting the agent to outside websites and apps — APIs and MCP.
  • Friday: turning your analysis into a website, and changing what runs underneath — other models, other coding agents, fully local.

Keep exploring

  • Everything in this course changes fast. What you learned this week is this month’s version, and next month there will be more.
  • So use the agent often, and explore on your own. Do not fence yourself in with what we happened to cover.
  • Try things. If it breaks, that is a lesson, and the repository lets you step back.