# From Developer to AI Engineer — pins for the measurement harnesses.
#
# Read out of the environment the runs were made in, not guessed. Python
# 3.12.13 on x86_64 macOS 14.8.1. Every version below is what `pip freeze`
# reported in the venv that produced the artifacts in runs/.
#
# Install:
#     python3.12 -m venv .venv-ch5
#     .venv-ch5/bin/pip install -r requirements.txt
#
# Why 3.12 and not something newer: fastembed's stack is pinned to it here,
# and the embedding numbers have to stay reproducible. See the note on
# sentence-transformers at the bottom.

# --- the model SDK -------------------------------------------------------
# The SDK baseline the whole book is verified against. `temperature` and
# `top_p` are absent from messages.create in 1.0.0 and later and reach the
# API through extra_body; Ch 1 measures this.
anthropic==1.2.0
pydantic==2.13.5
httpx==0.28.1

# --- embeddings, local and pinned ---------------------------------------
# A pinned local model is the only option where the book's recall numbers
# stay reproducible for a reader years from now. No torch.
fastembed==0.8.0
onnxruntime==1.23.2
numpy==2.5.2
tokenizers==0.23.1
huggingface_hub==1.29.0

# --- Postgres, Ch 6 only -------------------------------------------------
# Needed only by the Chapter 6 harnesses. Everything else runs without them.
psycopg==3.3.5
psycopg-binary==3.3.5
pgvector==0.5.0

# --- MCP, Ch 9 only ------------------------------------------------------
# Ch 9's server, client and spawn-cost harnesses. Installed in a separate
# venv (.venv-ch6) in the original runs because it pulls a web stack.
mcp==2.1.1

# =========================================================================
# The embedding model identifier, resolved
# =========================================================================
# The book asks fastembed for:
#
#     sentence-transformers/all-MiniLM-L6-v2       dim 384
#
# That string is the request, not the artifact. fastembed resolves it to
# Qdrant's ONNX conversion and that is what lands on disk:
#
#     .fastembed_cache/models--qdrant--all-MiniLM-L6-v2-onnx
#
# 91.1 MB over 5 files, 87 MB on disk. Runs record both the requested string
# and the resolved path, because they are not the same thing and a reader
# checking a hash needs the second one.
#
# The repo's latest commit is not what the book measured. On 2026-09-27 it
# moved tokenizer truncation from 128 to 256 tokens (model.onnx unchanged),
# which moves 13 of Ch 5's 40 top-5 rankings. The harnesses therefore pin
# the commit every run used and pass it to fastembed as specific_model_path:
#
#     EMBED_REPO = "qdrant/all-MiniLM-L6-v2-onnx"
#     EMBED_REVISION = "5f1b8cd78bc4fb444dd171e59b18f3a3af89a079"
#
# fastembed 0.8.0 has no revision argument of its own; revision= passed to
# TextEmbedding is ignored and fetches the latest commit (tested 2026-10-14).
#
# =========================================================================
# What is deliberately absent
# =========================================================================
# sentence-transformers. Tried first and unusable on x86_64 macOS: it needs
# transformers 5.x, which needs torch >= 2.5, and PyTorch's last x86_64
# macOS wheel is 2.2.2. No pin fixes it because the wheels do not exist.
# The install accounting for both attempts is in the book's Measured
# findings, because the honest cost is the part that does not fit in a
# sentence.
#
# =========================================================================
# Services, not pip packages
# =========================================================================
# Ch 6 needs a running Postgres with pgvector. Measured against:
#
#     PostgreSQL 17.11 (Homebrew), x86_64-apple-darwin23.6.0
#     pgvector 0.8.6
#
# The harnesses read BOOK_PG_DSN, defaulting to
# postgresql://postgres:ch11@localhost:5433/postgres
