Shared AI Memory System

Brain

Browse, filter, edit, and archive the shared memory store from one page.

Memories

1

Codex Sessions to Local Model Training Overview

active Edit Selected
Key
codex_local_model_training_from_sessions_2026_03_19
Source
contextkeep
Namespace
none
Doc Section
none
Created
2026-03-19 02:53
Updated
2026-03-19 02:53
Doc Version
none
Chunk
none
codex contextkeep fine-tuning hardware llama llm lora qlora training
Discussion on 2026-03-19 about using local Codex session logs to train a local model such as Llama 3/3.1 8B. Key conclusion: practical home-lab path is not pretraining like OpenAI, but post-training an existing instruct model using curated session data. Recommended ladder: first use retrieval over past sessions; next step is supervised fine-tuning with LoRA/QLoRA; advanced option is DPO if preference pairs exist; full pretraining from scratch is not realistic for home use. Important data-prep warning: do not train directly on raw ~/.codex/sessions/*.jsonl because those files contain session metadata, event records, tool traces, and encrypted reasoning fields. Instead, extract and curate clean user/assistant chat turns into a standard messages dataset. Example guidance: hold out 10-20 percent for evaluation and compare base vs fine-tuned model on real prompts. Tooling mentioned: Meta Llama Cookbook, PyTorch torchtune, Hugging Face TRL SFTTrainer. Hardware summary discussed from torchtune-style examples for 8B-class models: QLoRA can fit on 1x RTX 4090 at roughly 7.4 GiB peak VRAM in one example recipe; LoRA around 16.2 GiB; full finetune around 18.9 GiB. Explanation given: QLoRA uses a quantized frozen base model plus small trainable adapters; LoRA keeps frozen base weights at higher precision plus adapters; full finetune updates the full model weights and therefore also carries full gradients and optimizer state. Practical recommendation for this user: start with QLoRA on an 8B instruct model, use curated high-quality session examples only, and treat the published VRAM numbers as recipe-specific examples rather than guarantees. --- **2026-03-19 02:53:38 UTC | Created via MCP**

Edit Memory

View Selected