Trefolio Learning

Hands-on, runnable demos of AI/ML techniques

Every demo here is real, runnable code, not slides — the point is to see a technique work (and sometimes fail) step by step, with the actual source browsable inline, not just read a description of it.

RAG Live

A real, runnable Retrieval-Augmented Generation pipeline: chunking, embeddings, vector search, prompt assembly, and streamed generation — watched live, step by step. Includes a Classic vs. Agentic RAG comparison, a measured Embeddings vs. keyword-search comparison, and real Recall@K / Faithfulness evaluation metrics.

Embeddings Vector search Agentic RAG Evaluation
Open the demo →

Jump straight to a technique

Every entry below is a real tab or mode inside RAG Live, not a separate app — these links drop you directly into it.

Tokenization

The real gpt-4o-mini tokenizer (tiktoken), run on any text you paste — no API call.

Zero-shot vs. few-shot vs. CoT

Same question, same context, three prompting techniques compared side by side.

Temperature & sampling

The same prompt run at several temperature values — determinism vs. creativity, live.

Structured outputs

json_schema mode vs. free text, with hand-rolled schema validation shown.

LLM-based reranking

An optional rerank step between retrieval and generation — toggle it and compare.

Fine-tuning walkthrough

What a real fine-tuning example looks like, built from this project's own data.

A real toy classifier

A genuinely trained numpy-only classifier, measured against RAG on held-out questions.

Extended evaluation

Consistency across repeated runs, and real per-technique latency.

More techniques will be added here over time.