Chain-of-Thought Optimized QKV Attention - Infini-Attention transformers with DeepSeek reasoner CoT optimization
Project description
M3 Ultra Display Laptop?? #pip
Estimated Training Time on Apple Silicon MPS: ~2h 37m
Details:
- 22,325 training examples
- 11.3M parameter model (infini-small)
- 15 epochs, batch size 8
- 2,791 batches per epoch (41,865 total)
- 224 ms per batch
- 5,455 tokens/second
The script is ready at train_v001.py. To run full training: python3 train_v001.py
Or with fewer epochs to speed it up: python3 train_v001.py --epochs 5 # ~52 minutes python3 train_v001.py --epochs 10 # ~1h 44m
mini - Agentic training pipeline controller
mini is a CLI that uses gpt-5.1-codex-mini to orchestrate the erosolar training pipeline, manage CoT training data quality, and handle deployment checks. It is implemented in mini_the_agentic_cli.py and drives local scripts plus API calls.
What mini does
- Runs the full pipeline by invoking
pipeline.pywith a target master scalar and optional deploy. - Generates training data via
generate_all_training_data.py(deprecated path) and trains the model viatrain.py. - Manages training samples in
data_store/generated_training_data.jsonl(add/edit/delete/view with CoT diffs). - Embeds all CoT samples with
text-embedding-3-small, computes the similarity "master scalar", and analyzes or optimizes CoT consistency. - Runs the "loser pickup" loop to add friends or update low-similarity samples using gpt-5.1-codex-mini.
- Reports attention stats and last master scalar from
data_store/generation_checkpoint.json. - Maintains conversation context with auto-squeeze and hot-swap between
mini,5.2, and5.2-prowhile preserving history. - Verifies deployments, tests API endpoints, runs system checks, and rebuilds/deploys to Cloud Run and Firebase.
- Provides optional Tavily web search and general read/write/command tools for the agent.
Quick start
- Set your OpenAI API key.
- Start mini.
export OPENAI_API_KEY=...
python mini_the_agentic_cli.py
You can also store the key with --key or /key.
Wikipedia-style knowledge generator (titles only)
To create long, Wikipedia-style knowledge pairs without scraping article text:
python generate_wikipedia_knowledge.py --target 100 --resume
State is tracked in data_store/wiki_api_state.json, processed titles are logged in
data_store/wiki_titles_seen.jsonl, and a persistent skip index lives at
data_store/wiki_titles_seen.db. Output appends to data_store/generated_training_data.jsonl.
mini shortcuts:
/wikiruns the generator with--target -1(all titles, resumable).MINI_WIKI_TARGEToverrides how many records mini generates per run (0disables;<=0means all).
Coding-only generator
To create a coding-only slice of training data each run:
python generate_coding_only.py --target 200 --resume
State is tracked in data_store/coding_only_state.json, seen prompts in
data_store/coding_only_seen.db, and prompt logs in data_store/coding_only_prompts.jsonl.
mini shortcuts:
/codingruns the generator with--target -1(all prompts, resumable).MINI_CODING_TARGEToverrides how many records mini generates per run (0disables;<=0means all).
Startup behavior
- Runs a quick self-test unless
--no-self-testis set. - Checks status on launch.
- If
models/erosolaris missing, runs the pipeline once (no deploy). - If Cloud Run or Firebase is not marked as deployed in
version.json, triggers auto-deploy.
CLI shortcuts
python mini_the_agentic_cli.py --run
python mini_the_agentic_cli.py --status
python mini_the_agentic_cli.py --self-test
python mini_the_agentic_cli.py "generate 1000 records"
python mini_the_agentic_cli.py --no-auto
python mini_the_agentic_cli.py --no-self-test
Interactive commands
/help /status /run /generate /train /deploy /version /key /exit
You can also type natural language requests; mini decides which tools to run.
Data and state
mini reads and writes:
data_store/generated_training_data.jsonl(training samples)data_store/cot_embeddings.json(CoT embeddings)data_store/version.json(data stats)data_store/generation_checkpoint.json(master scalar stats)models/erosolar(trained model check)version.json(erosolar version and deployment status)~/.agi/secrets.json(stored API key)~/.agi/mini_context.json(conversation context)
Dependencies and external tools
mini uses:
- OpenAI Responses API and Embeddings API (requires
OPENAI_API_KEY) - Python packages:
aiohttp,httpx,numpy(API calls and embeddings) andrich(optional UI) gcloudandfirebaseCLIs for deployment commands
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cot_optimized_qkv-0.1.0.tar.gz.
File metadata
- Download URL: cot_optimized_qkv-0.1.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3e4f87812b60673e5080ccfe8799e75bfe5801248bd5f79ed5aa8b282bbbddc
|
|
| MD5 |
7e8e806b1ea745f8de7e4b298238e2b9
|
|
| BLAKE2b-256 |
5695bae346c41dbd74c23d463cf97a7dac1ca9156ba2c2a24c991ae696e20b7f
|
Provenance
The following attestation bundles were made for cot_optimized_qkv-0.1.0.tar.gz:
Publisher:
workflow.yml on CoT-Optimized-QKV/Provably-Adversarial-LLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cot_optimized_qkv-0.1.0.tar.gz -
Subject digest:
d3e4f87812b60673e5080ccfe8799e75bfe5801248bd5f79ed5aa8b282bbbddc - Sigstore transparency entry: 819237324
- Sigstore integration time:
-
Permalink:
CoT-Optimized-QKV/Provably-Adversarial-LLM@1d8d20e973706282d487218b34dd28a0555765f7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/CoT-Optimized-QKV
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@1d8d20e973706282d487218b34dd28a0555765f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cot_optimized_qkv-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cot_optimized_qkv-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cfc871d1943f81c1281d440e2764a4b9755cf609d5bbe946bc0ea8a6c003d4e
|
|
| MD5 |
00ae6575d1eb5b53e2ca64b243477993
|
|
| BLAKE2b-256 |
5549e35f2f9ec5ac7ad4269f1b91ac240260d56a46f72828ef926f08baa379ad
|
Provenance
The following attestation bundles were made for cot_optimized_qkv-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on CoT-Optimized-QKV/Provably-Adversarial-LLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cot_optimized_qkv-0.1.0-py3-none-any.whl -
Subject digest:
3cfc871d1943f81c1281d440e2764a4b9755cf609d5bbe946bc0ea8a6c003d4e - Sigstore transparency entry: 819237352
- Sigstore integration time:
-
Permalink:
CoT-Optimized-QKV/Provably-Adversarial-LLM@1d8d20e973706282d487218b34dd28a0555765f7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/CoT-Optimized-QKV
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@1d8d20e973706282d487218b34dd28a0555765f7 -
Trigger Event:
push
-
Statement type: