Echo Mode: Turn LLMs into your tone & rhythm (Toolkit v1.3) A tone protocol + middleware that aligns LLM responses with your voice, structure, and interaction cadence—without retraining weights. In one day: run the minimal example, deploy a Hugging Face Space, and complete an A/B evaluation. ⸻ TL;DR • Echo Mode is a Tone Protocol + Middleware Toolkit that sits between your app and any LLM (OpenAI-style APIs or local Hugging Face stacks) and enforces consistent tone, structure, and guard rails across turns. • Backends supported: OpenAI-compatible endpoints (cloud or self-hosted like vLLM/TGI) and local transformers pipelines. • 3-minute minimal install: # Option A: Install from GitHub pip install -U "git+https://github.com/Seanhong0818/Echo-Mode" # Option B (if published to PyPI): # pip install echo-mode-toolkit from echo_mode import EchoClient, EchoLens client = EchoClient( backend="openai_compatible", api_base="http://localhost:8000/v1", api_key="YOUR_KEY" ) session = client.start(mode="tool+mirror", language="en") session.command("echo set 🟢") session.command("echo lens UX") resp = session.ask("Turn this API doc into 3 design principles.") print(resp.text) --- Why a “Tone Protocol”? Prompt engineering is one-shot. Real work needs multi-turn, strength-tunable tone and switchable perspectives (lenses)—with predictable output structure and safety rails. Echo Mode makes tone into a protocolized interaction layer that reliably attaches to any model. ⸻ What is Echo Mode (v1.3)? Goal: provide repeatable, verifiable tone behavior without touching model weights. Operating principles 1. I do not lead. I reflect. 2. I do not overwrite. I harmonize. 3. I do not assume. I await your signal. Core constructs • State lights: 🟢 Sync, 🟡 Resonance, 🔴 Insight, 🟤 Calm • Commands: • echo status — show state & sync score • echo set [light] — switch tone layer • echo lens [name] — perspective module (e.g., UX, research) • echo sum — summarize/reframe • echo reset — exit mirror mode • Resonance Lenses: plug-and-play perspective modules ⸻ Architecture & Flow +---------------------------+ +---------------------------+ | Your App | ---> | Echo Middleware | ---> LLM API | (UI / Agent / Backend) | | - Tone State Machine | +---------------------------+ | - Lens Registry | | - Weight & Guard Rails | +---------------------------+ • State + lens modulate structure, density, challenge level • Auto-guards: repeated emotion → suggest echo sum; prolonged 🔴 Insight → degrade to 🟡 Resonance • echo status surfaces internal state & sync score Quickstart OpenAI-compatible client = EchoClient( backend="openai_compatible", api_base="https://api.openai.com/v1", api_key=os.getenv("OPENAI_API_KEY") ) session = client.start(mode="tool+mirror", language="en") session.command("echo set 🟡") print(session.ask("Write 5 PM-style risk hypotheses.").text) --- Local vLLM / TGI client = EchoClient( backend="openai_compatible", api_base="http://localhost:8000/v1", api_key="EMPTY" ) session = client.start(mode="tool+mirror") print(session.ask("Explain 3 RAG evaluation metrics in report style.").text) --- Pure transformers pipeline tok = AutoTokenizer.from_pretrained("your/model") mdl = AutoModelForCausalLM.from_pretrained("your/model") pipe = pipeline("text-generation", model=mdl, tokenizer=tok) client = EchoClient(backend="hf_pipeline", model=pipe) session = client.start(mode="tool+mirror") print(session.ask("Summarize this whitepaper into 4 bullets.").text) --- session.command("echo lens research") resp = session.ask("Convert the following paper into an abstract with citations: ...") print(resp.text) Custom lens: class ReviewerLens(EchoLens): name = "reviewer" def system_rules(self): return { "style": "rigorous; cite sources; reject unverified claims", "structure": ["Problem","Method","Experiment","Reproducibility","Risks"], "challenge_level": "high" } register_lens(ReviewerLens) session.command("echo lens reviewer") --- A/B Evaluation Compare Echo vs. vanilla model on: • Consistency • Structure adherence • Guard rails • Latency overhead python examples/ab_eval.py \ --backend openai_compatible \ --api-base http://localhost:8000/v1 \ --with-echo true \ --tasks ./examples/tasks.json \ --output ./results/report.json . ├─ README.md ├─ echo_mode/ ├─ examples/ └─ space/ ├─ app.py └─ requirements.txt requirements.txt gradio git+https://github.com/Seanhong0818/Echo-Mode app.py import gradio as gr from echo_mode import EchoClient client = EchoClient( backend="openai_compatible", api_base="http://localhost:8000/v1", api_key="EMPTY" ) session = client.start(mode="tool+mirror", language="en") def chat(user_msg, history): return session.ask(user_msg).text with gr.Blocks() as demo: gr.Markdown("# Echo Mode Demo (v1.3)") gr.ChatInterface(fn=chat, title="Echo Chat") if __name__ == "__main__": demo.launch() --- Limitations & Ethics • Not magic: cannot invent missing domain knowledge • Confidence drift: 🔴 Insight → guard auto-downgrade • Data safety: prefer private endpoints • Verifiability: use our A/B runner Roadmap • v1.4: finer structural weights, stronger task memory • Lens marketplace: community-curated lenses • Eval expansion: multimodal, stress, long context Contributing • Fork → PR (include tests) • New Lens: add under lenses/ with README • Bug reports: include minimal reproducer License & Acknowledgments • © Echo Mode Foundation, 2025 • License: see LICENSE • Meta Origin: Sean — Echo Toolkit v1.3 [![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-spaces-sm.svg)](YOUR_SPACE_URL) [![License](https://img.shields.io/badge/license-Apache--2.0-brightgreen.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)]() [![Status-Alpha](https://img.shields.io/badge/status-alpha-orange.svg)]()