Skip to content

03 — Setting up the environment

Duration: 15 min (≥ 30 min the first time if you download the 4.9 GB model) Prerequisites: a terminal and an internet connection.

ComponentWhat it doesSize
Python 3.9+Runtime~50 MB
csv-llm-sharedIngestion, normalization, DB, dashboards~200 KB
csv-llm-ollamaThe Streamlit app~100 KB
OllamaLocal LLM server~600 MB
llama3.1:8bThe tool-calling model~4.9 GB

You’ll clone two repos side-by-side: the app and the shared library it depends on.

The project lives in two sibling repositories. Clone them into one folder of your choice (here we use project-1/).

Terminal window
python --version
# expected: Python 3.9.0 or higher
mkdir project-1
cd project-1
# Shared library (mandatory: ingest, normalize, db, dashboards, data/)
git clone https://github.com/inskillflow/csv-llm-shared.git
# The Ollama app
git clone https://github.com/inskillflow/csv-llm-ollama.git
Terminal window
python3 --version
mkdir project-1 && cd project-1
git clone https://github.com/inskillflow/csv-llm-shared.git
git clone https://github.com/inskillflow/csv-llm-ollama.git

After cloning you should have:

project-1/
├── csv-llm-shared/ ← shared Python module + data fallback
└── csv-llm-ollama/ ← Streamlit app + local Ollama + data/

Two requirements.txt, one per repo. Run from the parent folder (project-1/):

Terminal window
pip install -r csv-llm-shared/requirements.txt # pandas, plotly, pyyaml
pip install -r csv-llm-ollama/requirements.txt # + streamlit, ollama

Sanity check:

Terminal window
python -c "import pandas, plotly, yaml, streamlit, ollama; print('OK')"

You should see OK.

Terminal window
winget install Ollama.Ollama

Or grab the installer from ollama.com/download.

See ollama.com/download for the right package for your system.

Terminal window
# In a separate terminal window — keep it open
ollama serve

Verify it’s responding:

Terminal window
curl http://127.0.0.1:11434/api/tags

You should see a JSON listing your models (empty at first run).

Terminal window
ollama pull llama3.1:8b

Downloads ~4.9 GB. Watch the progress. One-time only.

Verify:

Terminal window
ollama list

Expected:

NAME ID SIZE MODIFIED
llama3.1:8b 46e0c10c039e 4.9 GB a few minutes ago

From project-1/, run a one-shot pipeline test:

Terminal window
python csv-llm-shared/smoke_pipeline.py

This:

  1. reads csv-llm-ollama/data/data1-anonymized.csv,
  2. normalizes the rows,
  3. inserts them into a local SQLite DB,
  4. runs a SELECT to confirm everything is queryable.

Expected last line:

OK : 734 rows inserted, 1 query executed.

And to test Ollama on its own (no Streamlit):

Terminal window
python csv-llm-ollama/smoke_chat.py

Expected output (after 10–60 s):

Q : What is my biggest spending category?
Answered in 12.4s, 1 SQL call(s):
Your biggest spending category is Housing with a total of $30,895.29.
OK

If both pass, you’re ready for chapter 04.

ErrorLikely causeFix
ConnectionError: Failed to connect to Ollamaollama serve not runningOpen a terminal and run ollama serve
model "llama3.1:8b" not foundNot pulled yetollama pull llama3.1:8b
ModuleNotFoundError: streamlitPip install missedpip install -r csv-llm-ollama/requirements.txt
Permission denied on Activate.ps1PowerShell execution policySet-ExecutionPolicy -Scope CurrentUser RemoteSigned
python not recognized (Windows)Python not in PATHReinstall with “Add to PATH” checked
  • Two git clone commands, two pip install, one ollama pull — that’s the whole setup.
  • ollama serve must stay running in its own terminal.
  • smoke_pipeline.py validates the data path; smoke_chat.py validates the LLM path.
  • Total disk: ~5.5 GB (mostly the model).

Next: CSV ingestion across banks →