From 72a5c60ec1b05d69be958f762f33e40176815b77 Mon Sep 17 00:00:00 2001 From: akdeb Date: Sat, 9 May 2026 18:45:55 +0530 Subject: [PATCH] remove stale files --- server-fastapi/README.md | 256 ------------------ .../__pycache__/classic_route.cpython-313.pyc | Bin 1960 -> 0 bytes server-fastapi/classic_route.py | 55 ---- server-fastapi/env.example | 27 -- server-fastapi/models/llm/__init__.py | 20 -- .../llm/__pycache__/__init__.cpython-313.pyc | Bin 797 -> 0 bytes server-fastapi/models/stt/__init__.py | 16 -- .../stt/__pycache__/__init__.cpython-313.pyc | Bin 677 -> 0 bytes server-fastapi/models/tts/__init__.py | 17 -- .../tts/__pycache__/__init__.cpython-313.pyc | Bin 719 -> 0 bytes server/fastapi/README.md | 4 +- server/fastapi/bot.py | 4 +- .../{classic_route.py => voice_pipeline.py} | 4 +- 13 files changed, 6 insertions(+), 397 deletions(-) delete mode 100644 server-fastapi/README.md delete mode 100644 server-fastapi/__pycache__/classic_route.cpython-313.pyc delete mode 100644 server-fastapi/classic_route.py delete mode 100644 server-fastapi/env.example delete mode 100644 server-fastapi/models/llm/__init__.py delete mode 100644 server-fastapi/models/llm/__pycache__/__init__.cpython-313.pyc delete mode 100644 server-fastapi/models/stt/__init__.py delete mode 100644 server-fastapi/models/stt/__pycache__/__init__.cpython-313.pyc delete mode 100644 server-fastapi/models/tts/__init__.py delete mode 100644 server-fastapi/models/tts/__pycache__/__init__.cpython-313.pyc rename server/fastapi/{classic_route.py => voice_pipeline.py} (92%) diff --git a/server-fastapi/README.md b/server-fastapi/README.md deleted file mode 100644 index 194c2b3..0000000 --- a/server-fastapi/README.md +++ /dev/null @@ -1,256 +0,0 @@ -## ElatoAI: Realtime Voice AI Models on FastAPI - -`server-fastapi` is the simplest self-hosted Elato backend for people who want a normal Python server instead of an edge runtime. - -Use this if you want: - -- a FastAPI server you can run on your own machine or VM -- a classic `STT -> LLM -> TTS` voice pipeline -- a smaller provider surface that is easy to understand -- the same ESP32 transport shape as the rest of Elato - -If you are new to the project, read these first: - -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/README.md` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/README.md` - -## The Simple Provider Set - -To keep onboarding straightforward, the classic FastAPI route is centered around a small set of providers. - -### LLM - -- `openai` -- `claude` -- `gemini` -- `grok` - -### STT - -- `deepgram` -- `whisper` - -### TTS - -- `elevenlabs` -- `cartesia` -- `deepgram` -- `openai` - -The code still uses the `models/llm`, `models/stt`, and `models/tts` layout, but the active registry is intentionally trimmed so the default experience stays simple. - -## Default Setup - -The default classic route is: - -- STT: `deepgram` -- LLM: `openai` -- TTS: `elevenlabs` - -That gives people one obvious path to get running before they start swapping providers. - -## Project Layout - -```text -server-fastapi/ -├── bot.py -├── classic_route.py -├── esp32_transport.py -├── server.py -├── env.example -└── models/ - ├── llm/ - ├── stt/ - └── tts/ -``` - -## How The FastAPI Server Fits Into Elato - -Elato has three backend options right now: - -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/deno` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server/cloudflare` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi` - -A clean way to think about them is: - -- `Deno`: edge-first, mature provider integrations -- `Cloudflare`: Workers + Durable Objects + Workers AI -- `FastAPI`: normal Python server, easy to self-host, easy to reason about - -## Quick Start - -### 1. Create or activate your Python environment - -Use whatever you prefer. If you already use `uv`, that is a good default. - -### 2. Install dependencies - -This repo uses `pyproject.toml`, so install from that environment rather than a `requirements.txt` file. - -With `uv`: - -```bash -cd /Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi -uv sync -``` - -Or with plain pip in your venv: - -```bash -cd /Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi -pip install -e . -``` - -### 3. Create your env file - -Copy the example values from: - -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/env.example` - -Minimum example for the default route: - -```env -DEEPGRAM_API_KEY=your_deepgram_api_key -OPENAI_API_KEY=your_openai_api_key -ELEVENLABS_API_KEY=your_elevenlabs_api_key - -CURRENT_VOICE_ROUTE=classic -CLASSIC_STT_PROVIDER=deepgram -CLASSIC_LLM_PROVIDER=openai -CLASSIC_TTS_PROVIDER=elevenlabs - -ESP32_INPUT_SAMPLE_RATE=16000 -BROWSER_INPUT_SAMPLE_RATE=16000 -AUDIO_OUTPUT_SAMPLE_RATE=24000 -PIPELINE_AUDIO_IN_SAMPLE_RATE=16000 -PIPELINE_AUDIO_OUT_SAMPLE_RATE=24000 - -ALLOWED_ORIGINS=* -HOST=0.0.0.0 -PORT=7860 -``` - -### 4. Run the server - -If you use `uv`: - -```bash -cd /Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi -uv run server.py -``` - -If you use your activated venv directly: - -```bash -cd /Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi -python server.py -``` - -### 5. Point your ESP32 at the FastAPI backend - -Update the firmware config so your hardware connects to this server instead of the Deno or Cloudflare backend. - -The ESP32 route is: - -```text -/ws/esp32 -``` - -For browser or Next.js testing, the server also exposes: - -- `/ws/browser` -- `/ws/nextjs` - -## How Provider Selection Works - -The classic route reads three env vars: - -- `CLASSIC_STT_PROVIDER` -- `CLASSIC_LLM_PROVIDER` -- `CLASSIC_TTS_PROVIDER` - -So changing providers is just an env change. - -Examples: - -### OpenAI + Deepgram + ElevenLabs - -```env -CLASSIC_STT_PROVIDER=deepgram -CLASSIC_LLM_PROVIDER=openai -CLASSIC_TTS_PROVIDER=elevenlabs -``` - -### Whisper + Claude + Cartesia - -```env -CLASSIC_STT_PROVIDER=whisper -CLASSIC_LLM_PROVIDER=claude -CLASSIC_TTS_PROVIDER=cartesia -``` - -### Deepgram + Gemini + OpenAI TTS - -```env -CLASSIC_STT_PROVIDER=deepgram -CLASSIC_LLM_PROVIDER=gemini -CLASSIC_TTS_PROVIDER=openai -``` - -## Unified Experience Across Elato - -A simple way to keep the product understandable is: - -- keep the Next.js frontend focused on character creation and device management -- keep the ESP32 firmware focused on one transport protocol -- let users choose one backend runtime: - - Deno - - Cloudflare - - FastAPI -- inside each backend, expose the same conceptual knobs: - - `STT` - - `LLM` - - `TTS` - -That means the hardware story stays stable: - -- one firmware -- one websocket-style mental model -- three server deployment choices - -The cleanest unification strategy is not “every backend supports every provider.” -It is: - -- every backend should expose the same categories -- each backend should have one recommended default stack -- advanced users can swap providers later - -## Recommended Defaults - -If you want a simple opinionated experience for users, keep one default combo per backend. - -Suggested defaults: - -- `Deno`: OpenAI realtime -- `Cloudflare`: Workers AI STT/TTS + OpenAI LLM -- `FastAPI`: Deepgram + OpenAI + ElevenLabs - -That gives users one obvious starting point without taking away flexibility. - -## Important Files - -If you want to change the FastAPI backend, start here: - -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/server.py` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/classic_route.py` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/esp32_transport.py` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/models/llm/__init__.py` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/models/stt/__init__.py` -- `/Users/akashdeepdeb/Desktop/Projects/ElatoAI/server-fastapi/models/tts/__init__.py` - -## Current Notes - -- The filesystem still contains many scaffolded provider modules from the earlier broader experiment. -- The active provider registry is now intentionally much smaller. -- That means the codebase stays extensible, but the user-facing default path stays simple. diff --git a/server-fastapi/__pycache__/classic_route.cpython-313.pyc b/server-fastapi/__pycache__/classic_route.cpython-313.pyc deleted file mode 100644 index efd08aaa7254ecee4656853de1b5f4df44d79007..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1960 zcma)-%WvF77{JH&+UvDtPbytK6>mwzs>-hs}VwY7=`qg3&Zs!b0H3 z_=~tC(utl`X*LON+HpWuZI{q-h}2;c{cbjd(=Hq@pAJ$&NI2aPSP>iC$;4WJR@*zp z3q043_~L7`B{S8{mR_4Jn@Tr3)kt-wvIgM&v%yT#b+InhQ*-USB5GthS#@y^R>PVv zH`oe!t4ob+M>o}Z(N`Mzjt%2)GDUAykG%~jGlYTw-?u_x`}bvgv#{dP`O@Q z2}11KZZ8V#_M#g0@DBDp`$4pK{T2h+^_xYf4Lu2x7#BZxzF z{5vk3R+?pptY@)f)U_nYq!J`h3H&tAr)YQ22OVK|LKNG6Z1s7y?r%mB!=~74^a?x9 zn9Oe3@LA|yYwxhdceotx(gMFltXKSG8b)E@M8AP(p`*g+kMrNnKfe6VFP|P1K5o_e z9QO|jH(zmV929P~YR^*IH^$e-q58q0I&%J;Wn@`78$kNypEeG(>DI!Lb_pU!7vDRP zC0%JPoTgyRH=3M~<%i2ofgkZ}eaGM}< z5d2Z$vGU_cCd-Ps0^jzbkL3i3dou1I-ri68al!5ZO4ww zcCzUPWuUPf@jH`KMBnñ+f8J+GV^(tQOfxxF@wW;HarE~w|1A?Ov{xPtX_%5Il z* LLM -> TTS pipeline builder.""" - -from __future__ import annotations - -import os - -from character_prompt import LANGUAGE_LEARNING_PAL_PROMPT -from loguru import logger -from models.llm import create_llm_service -from models.stt import create_stt_service -from models.tts import create_tts_service -from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.audio.vad.vad_analyzer import VADParams -from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response_universal import ( - LLMContextAggregatorPair, - LLMUserAggregatorParams, -) - - -def build_classic_route(input_processor, context: LLMContext): - stt_provider = os.getenv("CLASSIC_STT_PROVIDER", "deepgram") - llm_provider = os.getenv("CLASSIC_LLM_PROVIDER", "openai") - tts_provider = os.getenv("CLASSIC_TTS_PROVIDER", "elevenlabs") - - logger.info( - "Building classic route with stt={} llm={} tts={}", - stt_provider, - llm_provider, - tts_provider, - ) - - stt = create_stt_service(stt_provider) - llm = create_llm_service( - llm_provider, - system_instruction=LANGUAGE_LEARNING_PAL_PROMPT, - ) - tts = create_tts_service(tts_provider) - - user_aggregator, assistant_aggregator = LLMContextAggregatorPair( - context, - user_params=LLMUserAggregatorParams( - vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=1)) - ), - ) - - processors = [ - input_processor, - stt, - user_aggregator, - llm, - tts, - ] - - return processors, assistant_aggregator diff --git a/server-fastapi/env.example b/server-fastapi/env.example deleted file mode 100644 index 8f22444..0000000 --- a/server-fastapi/env.example +++ /dev/null @@ -1,27 +0,0 @@ -DEEPGRAM_API_KEY=your_deepgram_api_key -OPENAI_API_KEY=your_openai_api_key -ANTHROPIC_API_KEY=your_anthropic_api_key -GEMINI_API_KEY=your_gemini_api_key -XAI_API_KEY=your_xai_api_key -ELEVENLABS_API_KEY=your_elevenlabs_api_key -CARTESIA_API_KEY=your_cartesia_api_key - -# Classic route providers -CURRENT_VOICE_ROUTE=classic -CLASSIC_STT_PROVIDER=deepgram -CLASSIC_LLM_PROVIDER=openai -CLASSIC_TTS_PROVIDER=elevenlabs - -# Transport and pipeline sample rates -ESP32_INPUT_SAMPLE_RATE=16000 -BROWSER_INPUT_SAMPLE_RATE=16000 -AUDIO_OUTPUT_SAMPLE_RATE=24000 -PIPELINE_AUDIO_IN_SAMPLE_RATE=16000 -PIPELINE_AUDIO_OUT_SAMPLE_RATE=24000 - -# Browser / Next.js access -ALLOWED_ORIGINS=* - -# WebSocket server settings -HOST=0.0.0.0 -PORT=7860 diff --git a/server-fastapi/models/llm/__init__.py b/server-fastapi/models/llm/__init__.py deleted file mode 100644 index fe825f2..0000000 --- a/server-fastapi/models/llm/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -"""LLM provider registry.""" - -from __future__ import annotations - -from models._provider_loader import load_provider_factory - -LLM_REGISTRY = { - "claude": "models.llm.anthropic", - "anthropic": "models.llm.anthropic", - "gemini": "models.llm.google_gemini", - "google_gemini": "models.llm.google_gemini", - "google_vertex_ai": "models.llm.google_vertex_ai", - "grok": "models.llm.grok", - "openai": "models.llm.openai", -} - - -def create_llm_service(provider_name: str, **kwargs): - factory = load_provider_factory(LLM_REGISTRY, provider_name, "LLM") - return factory(**kwargs) diff --git a/server-fastapi/models/llm/__pycache__/__init__.cpython-313.pyc b/server-fastapi/models/llm/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 26d562fce8be2437dcf304fae07948dff35244e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 797 zcmZWnO>fgM7`Br%?fSj4j;VAg3?|57El3Or3GD=`*vfim+&i|rjBA`(wjc0O<44>?$0A2v*9&N1d#(>=)$wSTT%?m8H3N^2!j-<)Wscu) zoPLA4!AtH9Y%^S2@LHZ{IgD7WZ@YGQ<^RYr;{kg^s2!FTgWNj`mlqt~fVtGx(?T^J zI_xsBH18+Wq`D~l(@d0S=DdSYEGR3~q?U;jJ*Sug%prs)cY&Os!+GowZXp>RPiu|xyqMZ{q1vr&q{p)8E7BQT834~aQC2Xnvkw%5+bsM z^oGHZGeUTLE^&Ew6@Q;V{2&;g{wgm)%CtEz#;h8{rFdKB0qh$(Y=_stj79bD0G!Jh v<5N^WLmOx4{<(@uo6+*ksCX-?HlwxeD8C*Rul+1#%F;OhYgNMQ(~^Gx$ll|( diff --git a/server-fastapi/models/stt/__init__.py b/server-fastapi/models/stt/__init__.py deleted file mode 100644 index 26cb9d7..0000000 --- a/server-fastapi/models/stt/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -"""STT provider registry.""" - -from __future__ import annotations - -from models._provider_loader import load_provider_factory - -STT_REGISTRY = { - "deepgram": "models.stt.deepgram", - "openai": "models.stt.openai", - "whisper": "models.stt.whisper", -} - - -def create_stt_service(provider_name: str, **kwargs): - factory = load_provider_factory(STT_REGISTRY, provider_name, "STT") - return factory(**kwargs) diff --git a/server-fastapi/models/stt/__pycache__/__init__.cpython-313.pyc b/server-fastapi/models/stt/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 4aaac670cf66811b7059f83831708999f4279610..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 677 zcmYjPJ8u&~5Z=8z`;1?SjS{5Dpd$~YD`HbXBqT%yvPe*htc`?HtXB5g9N2fK*>fVh z@=u^ifka6|$4}rVfM}8x9ZEqLWKqMcUu2}6`(}1#cD|XL6be~_@_yrQ@PQKY(-;eJ zW`Iui5S$T4fH2Ce1G;a4+n&q`No#+-RLO8eR<1 zNzj(yf$RnXM8rXDMyrPOYn%sRkZ@j&hq~MXDH6%i&rL?qlCX*; zig?r=RAcg^xb^YH=iM)B-;4Ee{UTTXmaDvbiR!CUnP3Dt#9s6G)i&uWIBh$yh{83OcYQ>~w9%J61C!fGNnr5hK2i28L lDZL<-OR{-M9$lqL>E3zq?)l2rZ`WD1#`!-*i{74=`3D)~wpaiF diff --git a/server-fastapi/models/tts/__init__.py b/server-fastapi/models/tts/__init__.py deleted file mode 100644 index efc7468..0000000 --- a/server-fastapi/models/tts/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -"""TTS provider registry.""" - -from __future__ import annotations - -from models._provider_loader import load_provider_factory - -TTS_REGISTRY = { - "cartesia": "models.tts.cartesia", - "deepgram": "models.tts.deepgram", - "elevenlabs": "models.tts.elevenlabs", - "openai": "models.tts.openai", -} - - -def create_tts_service(provider_name: str, **kwargs): - factory = load_provider_factory(TTS_REGISTRY, provider_name, "TTS") - return factory(**kwargs) diff --git a/server-fastapi/models/tts/__pycache__/__init__.cpython-313.pyc b/server-fastapi/models/tts/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index eaf3005d212ef60ecfab2213c8d74f347e23731b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 719 zcmY*WJ#Q015Z%2yf5acbHZqYSgN{HDSHz|O1QMbGStKY$)7fQ%alPoQ< z2|F;Oj2)I>NtR;issjm@Wow({wFAjc#>tqgcd26e>*1-AJ_f63*Mgk0Th3FZZIB?5b)UtEw*` zmMRec6ffQY#57Tyd-fs=t){g_n01FV=@WXN-XxyAuWi)iBk?S75T$dN@q?%J zXRLAX(zA7bHGU|1QYYWM70^*SbtZ-~tzFmE+e*Sv!cJSLSoDM1V#FG1RO37dgP8Mb zf22!3ND)hpb#54eFQJGnF5ywv&`rpX^&20af7 LLM -> TTS pipeline builder.""" +"""Default STT -> LLM -> TTS voice pipeline builder.""" from __future__ import annotations @@ -18,7 +18,7 @@ from pipecat.processors.aggregators.llm_response_universal import ( ) -def build_classic_route(input_processor, context: LLMContext): +def build_voice_pipeline(input_processor, context: LLMContext): stt_provider = os.getenv("CLASSIC_STT_PROVIDER", "deepgram") llm_provider = os.getenv("CLASSIC_LLM_PROVIDER", "openai") tts_provider = os.getenv("CLASSIC_TTS_PROVIDER", "elevenlabs")