Module 03 · 10 min
Connect a model
Choose a hosted or a local model, check it can drive AlbertCode SWE, pick a pace, and know where your keys are kept.
By the end of this module you can
- Connect a hosted provider or a model on your machine, and switch at any time
- Test that a model can drive AlbertCode SWE before you rely on it
- Say where keys are kept, where they go, and what the pace changes
AlbertCode SWE works with the model you choose. You can change models at any time, even between two tasks in the same session.
Choose where the model runs
- A major hosted provider, with an API key.
/connectlists every provider AlbertCode SWE supports. - Kimi (Moonshot), Hugging Face or OpenRouter, with a key or a token. OpenRouter gives you many vendors' models through one account.
- Any compatible API service, with its address and, if it needs one, a key.
- A model on your machine: Ollama, LM Studio, vLLM or another local model server. With a local model, your code never leaves your computer.
Connect a model in one of these places:
/connectin the terminal- Connect a provider in the browser
- Connect a Provider in VS Code
AlbertCode SWE checks that the key or address works before it saves it, and shows the provider as connected only once that check has passed. Then choose a model with /model, typing to narrow the list (Models).
Make sure it can drive AlbertCode SWE
The model must support tool calling reliably, because that is how it reads files, runs tests and makes changes. Most current hosted models do. Among local models, results vary with size and quantisation. Before you rely on a model, run:
albertcode models testThis sends the model one tool-calling request and tells you whether it handled it.
Pictures you attach reach the model as pictures only if it accepts images. When it doesn't, AlbertCode SWE tells you.
Pick a pace
| Pace | What it runs |
|---|---|
| thorough (the default) | An independent security review and an independent quality review on every governed change |
| fast | No reviews: about half the model calls |
The checks, the contract and both approvals apply at either pace. Switch with /pace fast or /pace thorough.
Where your keys go
Keys are kept on your computer by your system's own protection: the macOS Keychain, Windows data protection or your Linux keyring.
- A key is sent only to the provider it belongs to.
- Keys are never given to the commands AlbertCode SWE runs, and never shown to a model.
- AlbertCode SWE never shows a saved key again. The interface shows its last four characters, so you can tell which key is in place.
/disconnectremoves one key, and/disconnect allremoves them all.
Security has the details.
Practise
Find your local model server
A model on your machine is connected by its address. Match each server to the address it usually has.
Connect, choose, test and disconnect
Do this once with the provider you mean to use. AlbertCode SWE checks a key before it saves it.
- 1
In a project folder, run
albertcode. If nothing is connected the connect step opens by itself; otherwise:/connect - 2
Pick a provider and paste its key, or connect a model on your machine. Then choose a model, typing to narrow the list:
/model - 3
In a second terminal, check that the model can drive AlbertCode SWE:
albertcode models test - 4
Try the fast pace, then go back. Ask yourself what changes and what doesn't:
/pace fast - 5
Remove one saved key with
/disconnect, or every key with:/disconnect all
Check your understanding
6 questions. Answer 5 correctly to complete the module. Checked here, in your browser.