Skip to content

Commit 798d3b0

Browse files
committed
feat(tmlpd-pi): v1.3.2 discoverability release
- Value-prop description replacing arXiv jargon - Reallocated keywords to high-intent search terms - Demo SVG added - Token optimization module (semantic cache, context stratification) - Imprint plan doc
1 parent 86d1f30 commit 798d3b0

11 files changed

Lines changed: 1351 additions & 106 deletions

File tree

‎docs/IMPRINT_PLAN.md‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Imprint — Self-Learning Task Handler for A3M Router
2+
### *Every request leaves an imprint. Eventually, the imprints become instinct.*
3+
4+
**Package:** `imprint-router` (npm ✅ PyPI ✅) · **Product name:** Imprint · **Repo (planned):** `Das-rebel/imprint`
5+
**Status:** Plan v2 — rebuilt by agent council (Claude-MiniMax + Gemini-2.5 + research agents ×10)
6+
7+
---
8+
9+
## Executive Summary (council-rebuilt)
10+
11+
Imprint is a complementary service that watches A3M Router traffic, detects repeatable task
12+
patterns ("signatures"), and progressively optimizes them — **v1 by evolving context/skill-prompts,
13+
v2 by distilling weights into self-managed local adapters.** Its key differentiator is an adaptive
14+
learning policy driven by router economics data (cost-per-signature, cache affinity) that no
15+
competitor has. Promotion ladder (`shadow → canary → preferred → pinned`) with drift-triggered
16+
auto-demote ensures quality never silently regresses. The result: your AI bill decays over time.
17+
18+
---
19+
20+
## The Strategic Pivot (from council review)
21+
22+
**v1 evolves CONTEXT, not weights.**
23+
24+
| | Weight-distillation (old plan) | Context-evolution (new v1) |
25+
|---|---|---|
26+
| Mechanism | QLoRA per signature | Optimized skill-prompts + few-shot packs per signature |
27+
| Ship time | ~10 weeks to first value | **~3 weeks** |
28+
| Risk | Silent quality regression, GPU needed | Prompt-only failure modes, CPU-only |
29+
| Evidence | ACE framework: context often beats weights for narrow adaptation | SkillOpt (16K⭐) validates demand |
30+
| v2 role | — | Weights kick in when prompts plateau (Phase 3+) |
31+
32+
This directly addresses the council's #1 strategic flaw: weight-distillation-first was premature.
33+
Microsoft SkillOpt proves trace→skill works; nobody pairs it with router economics. That's our wedge.
34+
35+
---
36+
37+
## Architecture
38+
39+
```
40+
A3M Router ──telemetry──▶ Collector ──▶ Signature Miner ──▶ Skill Evolver (v1)
41+
▲ │ │
42+
│ ▼ ▼
43+
└────────── OpenAI-compatible ◀──── Promotion Ladder ◀──── Eval Gate
44+
endpoint: imprint-local (shadow→canary→preferred→pinned)
45+
│
46+
Phase 3+: Distiller (QLoRA via LoRAX)
47+
```
48+
49+
- **Serving backend (v2): LoRAX** (Apache-2, 3.8K⭐) — purpose-built multi-adapter serving on one 24GB GPU.
50+
- **Escalation-on-uncertainty:** low-confidence responses return `X-Imprint-Escalate: true`; A3M routes live.
51+
- **Loose coupling:** Imprint subscribes to A3M logs; appears back as provider `imprint-local` (cost≈0).
52+
53+
## The Killer Differentiator (open gap confirmed by research)
54+
55+
**Economics-driven learning policy:** signatures are prioritized for optimization by
56+
`monthly_savings = volume × (routed_cost − optimized_cost_estimate)` weighted by cache affinity.
57+
No competitor (SkillOpt, DSPy, OpenPipe, LoRAX) sees cost data — they optimize blindly.
58+
Imprint optimizes what's *worth* optimizing, and shows users a live "bill decay curve."
59+
60+
## Guardrails
61+
62+
- **Training refusal threshold:** <100 occurrences/week/signature → refuse to learn (maintenance > savings).
63+
- **Behavioral cloning objectives only** (accepted outputs); never train on unverified responses.
64+
- **Replay buffers + model merging** (v2) to prevent catastrophic forgetting across retrain cycles.
65+
- **Drift monitor:** embedding-distance + outcome-quality checks; auto-demote on drift.
66+
67+
## Phased Roadmap
68+
69+
| Phase | Duration | Deliverable | Exit criteria |
70+
|-------|----------|-------------|---------------|
71+
| **0: Validate** | 1 week | 24–48h traffic capture → top signature → manually optimize its prompt → measure Δcost | ≥30% cost cut on one real signature |
72+
| **1: Skill Evolver (v1)** | 3 wks | Automated prompt-skill evolution per signature + eval gate | 5 signatures auto-optimized, zero regressions |
73+
| **2: Promotion ladder** | 4 wks | shadow→canary→preferred state machine + drift demote | 3+ signatures live-preferred, 30 days no-touch |
74+
| **3: Distiller (v2)** | 6 wks | QLoRA via LoRAX for signatures where prompts plateaued | distilled adapter beats best prompt-skill |
75+
| **4: Productize** | — | `pip install imprint-router`, bill-decay dashboard, benchmark post | Public launch |
76+
77+
## Naming Decision (council split, resolved)
78+
79+
| Option | Verdict |
80+
|--------|---------|
81+
| ~~imprint~~ / ~~imprint-ai~~ | ❌ TAKEN on npm |
82+
| **imprint-router** ✅ | Available npm+PyPI; consistent with `a3m-router`; keeps your chosen brand |
83+
| knack-ai | Available; council minority pick; weaker tie to A3M story |
84+
85+
**Decision: Product = "Imprint" · Package = `imprint-router`**
86+
87+
## Next Step When Building
88+
Create `Das-rebel/imprint` repo with this PLAN.md + Phase 0 skeleton (collector notebook over real A3M logs).

‎tmlpd-pi-extension/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

‎tmlpd-pi-extension/docs/demo.svg‎

Lines changed: 33 additions & 0 deletions
Loading

‎tmlpd-pi-extension/package.json‎

Lines changed: 35 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "tmlpd-pi",
3-
"version": "1.2.2",
4-
"version_description": "v1.2.0 - Research-backed Multi-LLM Router based on arXiv: RouteLLM (2404.06035), RadixAttention (2312.07104), Medusa (2401.10774), FlashAttention (2407.07403). 120+ keywords for LLM/ML discoverability. 13 PI tools.",
5-
"description": "Research-backed Multi-LLM Router with parallel execution, learned routing (RouteLLM), prefix caching (RadixAttention), speculative decoding (Medusa/EAGLE), token compression (ISON), local LLM support (Ollama/vLLM/LM Studio), batch processing. Python bindings for LangChain/LlamaIndex/AutoGen/CrewAI. 120+ keywords: routellm, prefix-caching, speculative-decoding, medusa, flashattention, pagedattention, kv-cache, arxiv, research-backed, icml, neurips, iclr.",
3+
"version": "1.3.2",
4+
"version_description": "v1.3.2 - Discoverability release: value-prop description, reallocated keywords, README rewrite with demo. Run N LLMs in parallel, keep the best answer.",
5+
"description": "Run N LLMs in parallel, keep the best answer. Confidence-scored ensemble merging beats sequential fallback on latency and quality. 40-60% token savings built in.",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",
88
"bin": {
@@ -16,128 +16,57 @@
1616
"python:examples": "python3 python/examples.py"
1717
},
1818
"keywords": [
19-
"pi-extension",
20-
"pi",
21-
"pi-package",
22-
"pi-coding-agent",
23-
"pi-agent",
24-
"tmlpd",
25-
"treequest",
26-
"multi-llm",
19+
"parallel-llm",
20+
"ensemble-llm",
21+
"multi-model",
22+
"llm-fallback",
23+
"llm-ensemble",
2724
"parallel-ai",
25+
"multi-llm",
2826
"llm-orchestration",
2927
"llm",
28+
"llm-router",
29+
"model-routing",
3030
"agent-orchestration",
3131
"multi-agent",
32-
"agent",
33-
"parallel",
32+
"ai-agents",
33+
"autonomous-agents",
3434
"streaming",
3535
"cost-tracking",
3636
"cost-optimization",
37+
"llm-cost-reduction",
38+
"token-optimization",
39+
"token-compression",
40+
"context-compression",
41+
"semantic-caching",
3742
"cache",
3843
"caching",
44+
"prefix-caching",
45+
"kv-cache",
46+
"speculative-decoding",
3947
"circuit-breaker",
4048
"retry",
41-
"exponential-backoff",
42-
"mcts",
43-
"monte-carlo-tree-search",
44-
"workflow-optimization",
45-
"hierarchical-planning",
46-
"halo",
47-
"episodic-memory",
48-
"semantic-memory",
49-
"agent-memory",
50-
"python",
51-
"python-bindings",
52-
"pypi",
53-
"langchain",
54-
"llamaindex",
55-
"llama-index",
56-
"autogen",
57-
"crewai",
58-
"huggingface",
59-
"transformers",
60-
"agent-codegen",
61-
"ai-coding",
49+
"batch-processing",
50+
"local-llm",
51+
"ollama",
52+
"vllm",
6253
"openai",
6354
"anthropic",
64-
"google",
65-
"groq",
66-
"cerebras",
67-
"mistral",
68-
"xai",
69-
"zai",
7055
"claude",
71-
"gpt-4",
7256
"gemini",
73-
"llama",
74-
"model-router",
75-
"model-routing",
76-
"llm-router",
77-
"ai-agents",
78-
"autonomous-agents",
79-
"memory-based-router",
80-
"memory-based-llm-router",
81-
"multi-llm-router",
82-
"llm-memory-router",
83-
"adaptive-router",
84-
"adaptive-llm-router",
85-
"intelligent-router",
86-
"intelligent-llm-router",
87-
"learning-router",
88-
"contextual-router",
89-
"context-aware-router",
90-
"task-aware-router",
91-
"memory-augmented",
92-
"memory-augmented-llm",
93-
"episodic-memory-router",
94-
"semantic-memory-router",
95-
"task-memory",
96-
"cross-context-memory",
97-
"token-compression",
98-
"context-compression",
99-
"ison-format",
100-
"message-truncation",
101-
"context-management",
102-
"local-llm",
103-
"ollama",
104-
"vllm",
105-
"lmstudio",
106-
"local-model",
107-
"privacy-llm",
108-
"batch-processing",
109-
"batch-execution",
110-
"priority-queue",
111-
"rate-limiting",
112-
"token-counting",
113-
"cost-estimation",
114-
"cost-prediction",
115-
"parallel-execution",
57+
"groq",
58+
"langchain",
59+
"llamaindex",
60+
"autogen",
61+
"crewai",
62+
"python",
63+
"tmlpd",
64+
"pi-coding-agent",
65+
"routellm",
11666
"multi-provider",
11767
"fallback-chain",
118-
"intelligent-failover",
119-
"kv-cache",
120-
"routellm",
121-
"prefix-caching",
122-
"radix-attention",
123-
"speculative-decoding",
124-
"medusa",
125-
"eagle",
126-
"flashattention",
127-
"pagedattention",
128-
"kv-cache-quantization",
129-
"llmlingua",
130-
"streamingllm",
131-
"multimodel-orchestration",
132-
"multi-agent-debate",
13368
"self-consistency",
134-
"tensor-parallelism",
135-
"continuous-batching",
136-
"arxiv",
137-
"research-backed",
138-
"icml",
139-
"neurips",
140-
"iclr"
69+
"best-of-n"
14170
],
14271
"author": "Subho Das",
14372
"license": "MIT",

0 commit comments

Comments
 (0)