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.
Overview
Section titled “Overview”| Component | What it does | Size |
|---|---|---|
| Python 3.9+ | Runtime | ~50 MB |
| csv-llm-shared | Ingestion, normalization, DB, dashboards | ~200 KB |
| csv-llm-ollama | The Streamlit app | ~100 KB |
| Ollama | Local LLM server | ~600 MB |
llama3.1:8b | The tool-calling model | ~4.9 GB |
You’ll clone two repos side-by-side: the app and the shared library it depends on.
1. Python and the two repos
Section titled “1. Python and the two repos”The project lives in two sibling repositories. Clone them into one folder of your choice (here we use project-1/).
Windows (PowerShell)
Section titled “Windows (PowerShell)”python --version# expected: Python 3.9.0 or higher
mkdir project-1cd project-1
# Shared library (mandatory: ingest, normalize, db, dashboards, data/)git clone https://github.com/inskillflow/csv-llm-shared.git
# The Ollama appgit clone https://github.com/inskillflow/csv-llm-ollama.gitmacOS / Linux
Section titled “macOS / Linux”python3 --versionmkdir project-1 && cd project-1git clone https://github.com/inskillflow/csv-llm-shared.gitgit clone https://github.com/inskillflow/csv-llm-ollama.gitAfter cloning you should have:
project-1/├── csv-llm-shared/ ← shared Python module + data fallback└── csv-llm-ollama/ ← Streamlit app + local Ollama + data/2. Install Python dependencies
Section titled “2. Install Python dependencies”Two requirements.txt, one per repo. Run from the parent folder (project-1/):
pip install -r csv-llm-shared/requirements.txt # pandas, plotly, pyyamlpip install -r csv-llm-ollama/requirements.txt # + streamlit, ollamaSanity check:
python -c "import pandas, plotly, yaml, streamlit, ollama; print('OK')"You should see OK.
3. Install Ollama
Section titled “3. Install Ollama”Windows (winget)
Section titled “Windows (winget)”winget install Ollama.OllamaOr grab the installer from ollama.com/download.
macOS / Linux
Section titled “macOS / Linux”See ollama.com/download for the right package for your system.
Start the Ollama server
Section titled “Start the Ollama server”# In a separate terminal window — keep it openollama serveVerify it’s responding:
curl http://127.0.0.1:11434/api/tagsYou should see a JSON listing your models (empty at first run).
4. Pull the llama3.1:8b model
Section titled “4. Pull the llama3.1:8b model”ollama pull llama3.1:8bDownloads ~4.9 GB. Watch the progress. One-time only.
Verify:
ollama listExpected:
NAME ID SIZE MODIFIEDllama3.1:8b 46e0c10c039e 4.9 GB a few minutes ago5. Smoke test
Section titled “5. Smoke test”From project-1/, run a one-shot pipeline test:
python csv-llm-shared/smoke_pipeline.pyThis:
- reads
csv-llm-ollama/data/data1-anonymized.csv, - normalizes the rows,
- inserts them into a local SQLite DB,
- 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):
python csv-llm-ollama/smoke_chat.pyExpected 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.OKIf both pass, you’re ready for chapter 04.
Troubleshooting
Section titled “Troubleshooting”| Error | Likely cause | Fix |
|---|---|---|
ConnectionError: Failed to connect to Ollama | ollama serve not running | Open a terminal and run ollama serve |
model "llama3.1:8b" not found | Not pulled yet | ollama pull llama3.1:8b |
ModuleNotFoundError: streamlit | Pip install missed | pip install -r csv-llm-ollama/requirements.txt |
Permission denied on Activate.ps1 | PowerShell execution policy | Set-ExecutionPolicy -Scope CurrentUser RemoteSigned |
python not recognized (Windows) | Python not in PATH | Reinstall with “Add to PATH” checked |
Takeaways
Section titled “Takeaways”- Two
git clonecommands, twopip install, oneollama pull— that’s the whole setup. ollama servemust stay running in its own terminal.smoke_pipeline.pyvalidates the data path;smoke_chat.pyvalidates the LLM path.- Total disk: ~5.5 GB (mostly the model).