Spaces:
Paused
Paused
MacBook pro
commited on
Commit
·
f4b658d
1
Parent(s):
773db91
docs: B10 update README and SPEC with GPU metrics, voice stub, env vars
Browse files
README.md
CHANGED
|
@@ -14,9 +14,11 @@ license: mit
|
|
| 14 |
Phase 1–2 FastAPI + WebSocket echo scaffold (no ML models yet).
|
| 15 |
|
| 16 |
## Current Status
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Planned Phases
|
| 22 |
- GPU switch
|
|
@@ -32,5 +34,39 @@ pip install -r requirements.txt
|
|
| 32 |
uvicorn app:app --port 7860
|
| 33 |
```
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
## License
|
| 36 |
MIT
|
|
|
|
| 14 |
Phase 1–2 FastAPI + WebSocket echo scaffold (no ML models yet).
|
| 15 |
|
| 16 |
## Current Status
|
| 17 |
+
- GPU-backed metrics endpoint (`/metrics`, `/gpu`)
|
| 18 |
+
- Voice stub integrated (pass-through timing)
|
| 19 |
+
- Audio & Video echo functioning
|
| 20 |
+
- Frontend governed: audio chunk 160ms, video max 10 FPS
|
| 21 |
+
- Static client operational
|
| 22 |
|
| 23 |
## Planned Phases
|
| 24 |
- GPU switch
|
|
|
|
| 34 |
uvicorn app:app --port 7860
|
| 35 |
```
|
| 36 |
|
| 37 |
+
## Environment Variables
|
| 38 |
+
| Variable | Default | Description |
|
| 39 |
+
|----------|---------|-------------|
|
| 40 |
+
| `MIRAGE_CHUNK_MS` | `160` | Target audio capture & processing chunk duration (ms). Frontend currently hard-set; future: fetched dynamically. |
|
| 41 |
+
| `MIRAGE_VOICE_ENABLE` | `0` | Enable voice processing stub path (adds inference timing EMA). |
|
| 42 |
+
| `MIRAGE_VIDEO_MAX_FPS` | `10` | Target maximum outbound video frame send rate (frontend governed). |
|
| 43 |
+
| `MIRAGE_METRICS_FPS_WINDOW` | `30` | Rolling window size for FPS calculation. |
|
| 44 |
+
|
| 45 |
+
Export before launching uvicorn or set in Space settings:
|
| 46 |
+
```bash
|
| 47 |
+
export MIRAGE_VOICE_ENABLE=1
|
| 48 |
+
export MIRAGE_CHUNK_MS=160
|
| 49 |
+
uvicorn app:app --port 7860
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Metrics Endpoints
|
| 53 |
+
- `GET /metrics` – JSON with audio/video counters, EMAs (loop interval, inference), rolling FPS, frame interval EMA.
|
| 54 |
+
- `GET /gpu` – GPU availability & memory (torch or `nvidia-smi` fallback).
|
| 55 |
+
|
| 56 |
+
Example:
|
| 57 |
+
```bash
|
| 58 |
+
curl -s http://localhost:7860/metrics | jq '.video_fps_rolling, .audio_infer_time_ema_ms'
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Voice Stub Activation
|
| 62 |
+
Set `MIRAGE_VOICE_ENABLE=1` to activate the voice processor stub. Behavior:
|
| 63 |
+
- Audio chunks are routed through `voice_processor.process_pcm_int16` (pass-through now).
|
| 64 |
+
- `audio_infer_time_ema_ms` becomes > 0 after a few chunks.
|
| 65 |
+
- When disabled, inference EMA remains 0.0.
|
| 66 |
+
|
| 67 |
+
## Future Parameterization
|
| 68 |
+
- Frontend will fetch a `/config` endpoint to align `chunk_ms` and `video_max_fps` dynamically.
|
| 69 |
+
- Adaptation layer will adjust chunk size and video quality based on runtime ratios.
|
| 70 |
+
|
| 71 |
## License
|
| 72 |
MIT
|
SPEC.md
CHANGED
|
@@ -73,9 +73,9 @@ Planned collection (no aggregation service yet):
|
|
| 73 |
## Phases
|
| 74 |
| Phase | Status |
|
| 75 |
|-------|--------|
|
| 76 |
-
| 1 |
|
| 77 |
-
| 2 |
|
| 78 |
-
| 3 |
|
| 79 |
| 4 | Pending |
|
| 80 |
| 5 | Pending |
|
| 81 |
| 6 | Pending |
|
|
|
|
| 73 |
## Phases
|
| 74 |
| Phase | Status |
|
| 75 |
|-------|--------|
|
| 76 |
+
| 1 | Completed (Echo scaffold, static client) |
|
| 77 |
+
| 2 | Completed (Metrics + config + voice stub + GPU info) |
|
| 78 |
+
| 3 | In Progress (governance + groundwork for adaptation) |
|
| 79 |
| 4 | Pending |
|
| 80 |
| 5 | Pending |
|
| 81 |
| 6 | Pending |
|