Large Language Models in Finance · Chapter 1 / Lecture 1 · Setup

Tech Requirements

Install everything you need before the first session: Anaconda, VS Code, Node.js, Claude Code, Cline, and your API keys — on Windows, macOS, or Linux.
Juan F. Imbet  ·  EDHEC Business School / Paris Dauphine – PSL University
All commands here are taken from the official docs (links on each slide) — not invented. Verify every step works before class.
The big picture

Six pieces, one toolchain

You will install a Python stack, a code editor, a terminal AI agent, and the keys that let them talk to a model. Here is how the pieces fit together.

Anaconda Python 3.11 Jupyter · pandas · numpy scikit-learn · gensim VS Code + Python extension + Jupyter extension + Cline (AI agent) picks the Anaconda env as its interpreter Node.js installs & runs Claude Code (CLI) terminal coding agent API keys (Anthropic / OpenAI / HF) stored as environment variables, never in git
How the tools connect. Install left-to-right; the keys at the bottom feed the agent and your code.
Before you start

Two ground rules

  • Use the official downloads only. Every link on these slides points to the vendor's own site. Avoid mirrors and "download helper" sites.
  • Verify each step. After every install there is a one-line check (a --version command). If the check fails, fix it before moving on — later steps depend on earlier ones.
Git & the GitHub CLI
You will also install Git (to fetch the course code, and used by Claude Code on Windows) and the GitHub CLI gh — these get their own section (§6).
the bigger picture Anaconda gives you Python and the data libraries; VS Code is where you write and run code; Node.js exists only to install Claude Code; Cline is an AI agent that lives inside VS Code; the API keys are what authorise calls to a model.
01

Anaconda — Python and the scientific stack

One installer gives you Python, Jupyter, and every library the practicals use.
Install · Anaconda

Download and run the installer for your OS

Get the installer from anaconda.com/download. Pick the build that matches your machine.

Windows
Run the graphical .exe installer and accept the defaults. Afterwards use the Anaconda Prompt (Start menu) for conda commands.
macOS
Run the .pkg installer. Choose the Apple Silicon build on M-series Macs, the Intel build otherwise.
Linux
Download the .sh script, then run it:
bash ~/Downloads/Anaconda3-2024.10-1-Linux-x86_64.sh
Answer yes to run conda init.
Verify
Open a new terminal (Anaconda Prompt on Windows) and run:
conda --version
python --version
You should see a conda version and Python 3.x.
lighter alternative Short on disk space? Install Miniconda (docs.conda.io) instead — same conda command, without the bundled GUI apps.
Concept · the course environment

What a conda environment is — and why you need one

An environment is an isolated, named Python installation with its own set of packages. Different projects need different — often conflicting — library versions; environments keep each project's dependencies in their own sealed box so they never clash.

base (leave it alone)
The default environment that ships with Anaconda. Installing course packages here risks breaking other projects. We don't touch it.
llmfin (the course)
A clean box that holds exactly the libraries the practicals use — numpy, pandas, gensim, and the rest — at versions we know work together.
Two ways to use an environment
conda activate llmfin        # switch this terminal INTO the env; prompt shows (llmfin)
python gen_king_analogy.py   # ...now plain python uses the env's interpreter

conda run -n llmfin python gen_king_analogy.py   # run ONE command in the env, no activation
  • Why not just python? Bare python runs whichever interpreter is first on your PATH — usually base or the system Python, which lack the course libraries. You'd hit ModuleNotFoundError: No module named 'gensim'. Activating (or conda run) guarantees the right interpreter.
  • Which env am I in? Run conda env list — the * marks the active one — or check the (llmfin) tag at the start of your prompt.
Create · the course environment

One environment, all the dependencies

Create an isolated environment named llmfin, then install the course requirements into it. Run these from the course folder (next section shows how to get it).

conda create -n llmfin python=3.11
conda activate llmfin
pip install -r code/requirements.txt
pip install -e code/
  • requirements.txt pulls numpy, pandas, matplotlib, scikit-learn, jupyter, gensim, yfinance and more.
  • pip install -e code/ installs the course's own llmfin helper package in editable mode.
Register it as a Jupyter kernel
python -m ipykernel install --user --name llmfin --display-name "Python (llmfin)"
Now notebooks can run on the Python (llmfin) kernel.
02

VS Code — your editor and notebook host

Plus three extensions: Python, Jupyter, and the Cline AI agent.
Install · VS Code

Get the editor from code.visualstudio.com

Windows
Run the User Setup .exe, or:
winget install Microsoft.VisualStudioCode
macOS
Open the download, drag Visual Studio Code to Applications, or:
brew install --cask visual-studio-code
Linux
Install the downloaded package:
sudo apt install ./code_*.deb   # Debian/Ubuntu
sudo dnf install ./code-*.rpm   # Fedora/RHEL
Enable the code command (handy)
On macOS: Command Palette (Cmd+Shift+P) → Shell Command: Install 'code' command in PATH. Then code . opens the current folder. Windows and Linux installers add it for you.
Install · VS Code extensions

Four extensions — install from the Extensions view

Open the Extensions view (Ctrl+Shift+X, or Cmd+Shift+X on macOS), type each name in the search box, and click Install. The exact marketplace IDs:

ExtensionPublisherMarketplace IDWhat it does
PythonMicrosoftms-python.pythonRun/debug Python, pick interpreters
JupyterMicrosoftms-toolsai.jupyterRun .ipynb notebooks in the editor
Claude CodeAnthropicanthropic.claude-codeClaude as a panel in VS Code (sign in — no API key; needs VS Code 1.98+)
ClineCline Botsaoudrizwan.claude-devAutonomous AI coding agent (see §4)
Prefer the terminal? Install all four at once
code --install-extension ms-python.python
code --install-extension ms-toolsai.jupyter
code --install-extension anthropic.claude-code
code --install-extension saoudrizwan.claude-dev
(The code command comes from the VS Code install in §2.)
Point VS Code at your environment
Ctrl/Cmd+Shift+PPython: Select Interpreter → choose llmfin. When you open a notebook, click Select KernelPython (llmfin).
03

Node.js & Claude Code — the terminal agent

Node is the prerequisite; Claude Code is Anthropic's command-line coding agent.
Install · Node.js

Install the current LTS (v24)

Get the LTS build from nodejs.org/en/download. The npm route for Claude Code needs Node 18 or later — LTS is well above that.

Windows
Run the official .msi installer (or use winget / Chocolatey).
macOS
Official installer, or:
brew install node
Linux
Use nvm (works on macOS too) or your distro package manager.
Verify
node --version
npm --version
Install · Claude Code

The native installer is the recommended route

macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell
irm https://claude.ai/install.ps1 | iex
Alternative: via npm
Requires Node 18+. Do not use sudo:
npm install -g @anthropic-ai/claude-code
Verify & diagnose
claude --version
claude doctor
Windows tip Installing Git for Windows is optional but recommended — it lets Claude Code use Bash. Native installs auto-update in the background.
Run · Claude Code

Start it and log in

Open a terminal inside the project folder you want to work on and run:

claude
  • On first run it opens your browser to log in and authenticate.
  • Claude Code requires a Pro, Max, Team, Enterprise, or Console account — the free Claude.ai plan does not include it. (It can also run against Bedrock / Vertex / Foundry.)
  • System requirements: macOS 13+, Windows 10 (1809+), or Ubuntu 20.04+ / Debian 10+, 4 GB+ RAM.
why this matters Claude Code is how you will run the AI-agent workflows in the later chapters from the terminal — driving real files and commands, not just chatting.
04

Cline — an AI agent inside VS Code

Same idea as Claude Code, but as a graphical panel in the editor.
Configure · Cline

Install the extension, then connect a model

You already installed Cline (saoudrizwan.claude-dev) in §02. It is an autonomous agent that can create/edit files and run commands — with your approval at each step.

  • Open Cline from the activity bar icon, or run Cline: Open In New Tab from the Command Palette.
  • On first open, complete provider setup in Cline settings. You can use the built-in Cline provider (pay-as-you-go), or bring your own key — e.g. an Anthropic API key or an OpenRouter key.
  • Pick a model (Claude works well) and you are ready.
two flavours, one idea Use Claude Code in the terminal and Cline in the editor. Both are agentic assistants; pick whichever fits the task. The next section sets up the key they share.
05

API keys — authorising the model calls

One Anthropic key covers the course; OpenAI and Hugging Face appear in a few examples.
The big picture

What an API key actually does

Your code (or Cline) sends a request plus your secret key; the provider checks the key, runs the model, and bills your account.

Your code / Cline prompt + API key Anthropic API checks key · routes request Claude model generates response HTTPS response travels back
The key is a password. Anyone who has it can spend your credits — so it never goes into your code or git.
Create · Anthropic key

Generate a key, then set it as an environment variable

  1. Sign in at console.anthropic.com and add billing credits.
  2. Go to Settings → API keys → Create Key. Copy it now — it looks like sk-ant-api03-... and is shown only once.
  3. Store it as an environment variable named ANTHROPIC_API_KEY (the Anthropic SDK and tools read this automatically):
macOS / Linux
export ANTHROPIC_API_KEY="sk-ant-api03-..."
Add that line to ~/.zshrc or ~/.bashrc to make it permanent.
Windows
setx ANTHROPIC_API_KEY "sk-ant-api03-..."
Then open a new terminal so the variable is picked up.
Use it from Python
pip install anthropic
anthropic.Anthropic() reads ANTHROPIC_API_KEY from the environment — no key in your code.
Security & the other providers

Keep keys secret; two more keys for a few examples

never commit a key Keys go in environment variables or a .env file that is listed in .gitignore. Never paste a key into a notebook, a commit, or a screenshot. If one leaks, revoke it in the console immediately.
OpenAI (optional)
Create a key at platform.openai.com/api-keys; store it as OPENAI_API_KEY. Used in the OpenAI examples in Chapter 1.
Hugging Face (optional)
Create a token at huggingface.co/settings/tokens; store it as HF_TOKEN or run huggingface-cli login. Used for open-weight models.
06

Git & the GitHub CLI

Version control to fetch the course code — and gh for everything else on GitHub.
Install · Git

Git — you need it to clone the course repository

Git is also what Claude Code uses for its Bash tool on Windows. Get it from git-scm.com/downloads, or via a package manager:

Windows
Official installer, or:
winget install Git.Git
macOS
Often preinstalled; otherwise:
brew install git
or xcode-select --install
Linux
sudo apt install git   # Debian/Ubuntu
sudo dnf install git   # Fedora/RHEL
Verify & introduce yourself
git --version
git config --global user.name  "Your Name"
git config --global user.email "you@example.com"
Install · GitHub CLI

gh — GitHub from the terminal: auth, clone, pull requests, issues

The GitHub CLI logs you in to GitHub once and then handles cloning over HTTPS, pull requests, and issues. Get it from cli.github.com, or:

Windows
winget install GitHub.cli
macOS
brew install gh
Linux
sudo dnf install gh   # Fedora/RHEL
Debian/Ubuntu: follow the signed-keyring apt steps at cli.github.com.
Verify & log in
gh --version
gh auth login        # opens a browser to authenticate
After gh auth login, the CLI also manages Git's GitHub credentials for you — no tokens to paste.
07

Get the course code & check everything works

Clone the repo, install into your environment, and run the final checklist.
Get · the course repository

Clone it and open it in VS Code

git clone https://github.com/jfimbett/llm-finance-book.git
cd llm-finance-book
conda activate llmfin
pip install -r code/requirements.txt
pip install -e code/
code .

Then open code/practicals/01-intro/practical.ipynb and select the Python (llmfin) kernel.

Verify · the final checklist

Run these — every line should succeed

conda --version
python --version
node --version
claude --version
git --version
gh --version
python -c "import pandas, numpy, sklearn, gensim; print('libs ok')"
python -c "import anthropic; print('sdk ok')"
8
checks pass
3
extensions installed
1
key in your environment
you're ready If all eight lines run without error and Claude Code logged in, your machine is set up for the whole course. Bring it to the first session working.
If something breaks

Where to get unstuck

  • Claude Code: run claude doctor; see the official troubleshooting guide at code.claude.com/docs.
  • conda / Python: make sure you opened a new terminal after install and ran conda activate llmfin.
  • VS Code can't find Python: re-run Python: Select Interpreter and choose the llmfin environment.
  • Key not found: open a new terminal after setx / editing your shell profile, and confirm the variable is set.
ask early Hit a wall? Post the exact error message (not a screenshot of your key) on the course channel before the first session — most setup issues take minutes to fix once we see the message.