agentic_ai_basics

llm_backbone

LLM (Backbone) — the large language model that serves as the reasoning engine inside an agent, swappable independently of the agent’s architecture.

llm_backbone.py

Runs one fixed harness — same system prompt, same tool, same loop shape as ../tool_use/basic_agentic_tools.py — against the identical task under two different models (claude-haiku-4-5 and claude-sonnet-5), printing each one’s answer, token usage, and time taken side by side. Type your own task, or press enter for the built-in default.

Concepts covered

Run

From the repo root:

pip install -r requirements.txt
export ANTHROPIC_API_KEY=your-key-here
python3 Core_Architecture/llm_backbone/llm_backbone.py

Try:

Task to give both backbones (blank for a default demo):
> A store is offering 30% off a $85 jacket. What's the final price?

Running the same harness with 2 different backbones on:
  A store is offering 30% off a $85 jacket. What's the final price?

--- backbone: claude-haiku-4-5 ---
answer: The final price is $59.50.
tokens: 412 in / 18 out | time: 1.1s

--- backbone: claude-sonnet-5 ---
answer: The final price is $59.50, after a $25.50 discount.
tokens: 486 in / 27 out | time: 1.8s

Configuration

See also