Heidelberg AICurriculum
Track 19 · Beginner
19.5

Where the AI comes from

One switch decides which model every app on your bench answers with

3 lessons 2026-08-13 AI-generated

1Overview

One setting — "Which AI answers" — that every app on the bench inherits through a LiteLLM gateway.

Every app on the bench asks one gateway for a model called `default`. Change what `default` means and n8n, AnythingLLM, Hermes and everything you install later follow — no app is reconfigured, no key is pasted twice. This chapter walks the four honest options: the model on your own disk, a model on another machine you own, an EU-hosted router, and a global one — with what each costs and where your text goes. → `bench-model` is the model that ships with the bench; `litellm` is the gateway on a server you administer.

A gateway in the middle is the whole trick. Each app is configured once, at install, to talk to `http://litellm:4000/v1` and ask for a model called `default`. What `default` resolves to is one line of configuration the dashboard rewrites for you. That is why swapping a 3-billion-parameter model on your laptop for a frontier model in Frankfurt takes one click and breaks nothing: the apps never knew which model they were talking to. It is also the pattern you would use on a real server — the same LiteLLM, the same idea, one size up.

1.2After this chapter you can
Switch every app on the bench to a different model in one place
Weigh the four options by cost, capability and where the data is processed
Point the bench at a model running on another machine you own
Explain why no app has to be reconfigured when the provider changes
1.3When to reach for it

When the bench model is too small for a task, when you want to work offline, or when a document must not leave the EU.

1.4Key parts

The gateway serves two names: `default` for the apps, and `hermes` so the agent can be pointed somewhere of its own.

1.5Watch out

OpenRouter routes outside the EU unless you are on its enterprise plan. Requesty and EUrouter process inside it. For university data that sentence is the decision.

1.6Free vs paid

The bench model and LM Studio cost nothing but your own hardware. Routers charge the provider price plus a small markup — a seminar afternoon is cents.

2Lessons 3

2.1 One gateway, one name, every app

LiteLLM is a small server that speaks the OpenAI API and forwards to whatever actually answers. On the bench it runs on port 4000 and every app points at it.

Understand why one switch can change the AI for five apps at once.

Trycurl -s -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://localhost:4000/v1/models

in a terminal, with the key from the .env in your HeidelbergBench folder. It lists what the gateway serves.

  1. Two names, always. default is what n8n, AnythingLLM and the rest ask for. hermes exists so the agent can use a different model without disturbing anything else.
  2. The apps are configured once. Their .env says LLM_BASE_URL=http://litellm:4000/v1. Nothing in them names a model provider.
  3. So switching is one file. The dashboard rewrites litellm/config.yaml and restarts the gateway — a few seconds, and no app notices more than a blip.
  • You'll see A JSON list with two entries: default and hermes.
  • Takeaway Configure the apps once against a name; move the name. That is what a gateway buys you.

2.2 The four options, and what each one costs you

Do this first One gateway, one name, every app

Pick a provider for a real task instead of always taking the default.

One dialog, every app. Change what answers here and nothing downstream is reconfigured — "Ask it" checks the address before you commit.
  1. The bench model (qwen2.5:3b, on your disk). Free, offline, private. Small: it summarises, extracts, drafts and demonstrates. It will not reason through a hard problem.
  2. LM Studio, on your machine or a lab machine. Free, and as big as the hardware allows. The bench asks the address what it serves rather than guessing a model name.
  3. Requesty or EUrouter. Frontier models, processed in the EU, paid per token. This is the answer when quality matters and the data is sensitive.
  4. OpenRouter. The widest selection and usually the cheapest, but routing leaves the EU unless you are on its enterprise plan.
  • You'll see The dashboard names your choice under "Which AI answers", and the model line changes on every app tile.
  • Takeaway Small-and-local, big-and-yours, big-and-EU, big-and-global. Almost every real choice is one of those four.
  • Check A seminar analyses interview transcripts that may not leave the university. Which two options remain?
  • Cost Local: electricity. EU routers: provider price plus roughly 5%. Nothing is charged without a key you pasted yourself.

2.3 Point the bench at a model on another machine

A laptop is a weak place to run a model and a fine place to run apps. If there is a workstation, a lab machine or a GPU box on your network, the bench can use its model while everything else stays on your laptop.

Do this first The four options, and what each one costs you

Use a stronger model without paying anyone, by borrowing a machine you already have.

  1. On the other machine: run LM Studio, load a model, and turn on its local server. Note the address it prints, usually http://:1234/v1.
  2. On the bench: Change under "Which AI answers", choose LM Studio, and give that address. The setup asks it what models it serves and takes the first one — a name nobody has to type correctly.
  3. If it is the same machine, the address from inside a container is http://host.docker.internal:1234/v1, not localhostlocalhost inside a container is the container.
  4. Check it took. The tiles now say that model, and one question in "Ask the course" comes back noticeably faster or better.
  • You'll see Every app tile shows the new model name within a few seconds of the switch.
  • Takeaway The gateway does not care where the model runs. Neither should your apps.

💬 Discuss this chapter

Ask, share, or report — over on the Heidelberg AI community forum.