Commit Graph

15 Commits

Author SHA1 Message Date
LyAhn 13085166fb feat(phase-1): persistent generation library
- Save every completed generation to SQLite (generation_store.py) with
  WAV and waveform peaks written to data/generations/<id>/
- Deferred DB write until success — cancelled/errored generations never
  touch the DB and never appear in the library
- Fixed cancel+regenerate IndexError: _reset_scheduler_caches() now
  directly zeros scheduler._step_index and running state in addition to
  clearing VibePod cache dicts; same explicit resets added in the fresh
  path of prepare_noise_scheduler as belt-and-suspenders
- Added /library page with GenerationCard, WaveformPreview, waveform
  fetch, play/pause, download, delete, pagination, empty + error states
- Added generation API routes (list, single, audio stream, waveform,
  delete) proxying to Python server
- Added Library nav link to Header with active state
- Persist script/speaker/CFG to localStorage so generate page state
  survives navigation
- Updated build plan: Phase 0+1 ticked off, better-sqlite3 moved to
  Phase 2, architectural note on Python owning all persistence
2026-05-02 23:05:11 +01:00
LyAhn 47e0c7e512 chore(phase-0): stabilise foundation for Studio build
- Extract WAV assembly (buildWav, mergeFloat32Arrays, decodeFloat32Chunk,
  SAMPLE_RATE) into web/lib/audio/wav.ts so it can be reused by the
  Studio playback engine and library waveform previews
- Add server/waveform.py with compute_peaks() / write_peaks() — reads
  any WAV, mixes to mono, returns min/max peak arrays matching the
  WaveformPeaks TypeScript type
- Add server/ids.py with prefixed URL-safe ID helpers (gen_id, proj_id,
  asset_id, etc.) using stdlib secrets — no new dependency
- Add docs/studio-build-plan.md — full execution spec covering stack
  decisions, data models, API contract, component hierarchy, phase
  breakdown and acceptance criteria
- Ignore data/ directory (generated audio, waveforms, SQLite DB)
2026-05-02 17:24:45 +01:00
LyAhn a351910fd2 style: apply prettier formatting across all source files 2026-05-01 18:36:42 +01:00
LyAhn d60c5ae498 chore: add prettier + enforce LF line endings
- Add .prettierrc (double quotes, 2-space, trailing comma es5, LF, 100 cols)
- Add .prettierignore (excludes node_modules, .next, server/, lock files)
- Add .editorconfig (LF + per-language indent rules for all editors)
- Expand .gitattributes to cover all text file types with eol=lf
- Add prettier@^3.5.3 devDep at workspace root with format/format:check scripts
- Add format/format:check scripts to web/package.json
2026-05-01 18:36:04 +01:00
LyAhn 01ab3d1fc4 perf(cpu): tune streaming playback
Keep CPU async decode enabled without CFG parallelism, expand CPU buffering defaults for smooth playback, prevent CPU startup from mutating the lockfile during thread autodetection, and document runtime tuning variables in the example environment file.
2026-04-30 23:20:46 +01:00
LyAhn 75b84b211b perf: improve streaming generation pipeline
Add CUDA inference hot-path optimizations, safer attention fallback handling, and generation profiling hooks. Improve SSE streaming, browser buffering telemetry, and playback recovery while preserving default audio quality settings.
2026-04-30 18:54:14 +01:00
LyAhn a39ec536fd Improve CPU Inference Stability: Adaptive Buffering & Chunk Accumulation (#11)
* Improve CPU Inference Stability: Implement Adaptive Buffering and Chunk Accumulation

This change addresses audio stuttering issues when running on CPU-only hardware by:
- Implementing server-side audio chunk accumulation to reduce SSE overhead.
- Introducing device-aware default configurations for buffering and inference steps.
- Exposing key performance parameters as environment variables.
- Enabling the frontend to adaptively adjust its buffering thresholds based on the server's configuration.

Changes:
- Modified `server/vibevoice_server.py` to support accumulation and provide config via `/health`.
- Updated `web/hooks/useStreamingGeneration.ts` to accept configurable buffering parameters.
- Updated `web/app/page.tsx` to fetch and apply server-side configuration.

Verified on CPU mode in the development environment.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>

* Improve CPU Inference Stability: Implement Adaptive Buffering and Chunk Accumulation

This change addresses audio stuttering issues when running on CPU-only hardware by:
- Implementing server-side audio chunk accumulation to reduce SSE overhead.
- Introducing device-aware default configurations for buffering and inference steps.
- Exposing key performance parameters as environment variables.
- Enabling the frontend to adaptively adjust its buffering thresholds based on the server's configuration.

Changes:
- Modified `server/vibevoice_server.py` to support accumulation and provide config via `/health`.
- Updated `web/hooks/useStreamingGeneration.ts` to accept configurable buffering parameters.
- Updated `web/app/page.tsx` to fetch and apply server-side configuration.

Verified on CPU mode in the development environment.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>

* Improve CPU Inference Stability: Adaptive Buffering UI & Logic

This change enhances the initial CPU stability fix by:
- Exposing adaptive buffering settings (Pre-buffer, Re-buffer Threshold, Resume Threshold) in a new "Advanced Buffering" UI section.
- Managing buffering settings in the application state to allow for manual overrides.
- Implementing robust re-initialization of buffering and inference defaults whenever the server's device (CPU/CUDA) changes.
- Including the active device in the server's config object for reliable client-side detection.

Verified with frontend screenshots and full build. Responds to PR feedback regarding actioning the adaptive logic.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>

* Refine adaptive buffering: env helpers, threshold validation, a11y fixes

- Extract _env_int/_env_float helpers in server to validate env-var config
  with graceful fallback instead of bare int/float casts
- Fix inference_steps falsy-check (0 is valid) to use explicit None guard
- Enforce rebufferThresholdSecs < resumeThresholdSecs in both the hook
  (with console.warn + clamp) and the GenerationControls UI (sliders block
  invalid states by auto-bumping or ignoring the drag)
- Add type="button", aria-expanded, aria-controls, htmlFor, and input id
  attributes to GenerationControls for accessibility
- Add .vscode/settings.json to .gitignore; sort package.json scripts

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-30 16:03:35 +01:00
LyAhn 84e387ec42 Merge pull request #7 from JezzWTF/refactor-audio-player-abort-controller-5486095809189155006
🧹 [Refactor] Use AbortController for event listeners in useAudioPlayer
2026-04-29 09:26:33 +01:00
google-labs-jules[bot] 153b63a90c 🧹 [Refactor] Use AbortController for event listeners in useAudioPlayer
- Replaced multiple named event handler functions with inline state setters.
- Used an AbortController to cleanly remove all event listeners with a single `controller.abort()` call in the cleanup hook.
- This improves maintainability and readability by reducing verbosity without changing functionality.
- Formatted inline callbacks across multiple lines for better readability as requested.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>
2026-04-29 08:19:17 +00:00
LyAhn 68174b9d67 feat: surface VIBEPOD_DEVICE (CPU/CUDA) in the frontend header 2026-04-29 08:43:07 +01:00
google-labs-jules[bot] 18a97e0bea 🧹 [Refactor] Use AbortController for event listeners in useAudioPlayer
- Replaced multiple named event handler functions with inline state setters.
- Used an AbortController to cleanly remove all event listeners with a single `controller.abort()` call in the cleanup hook.
- This improves maintainability and readability by reducing verbosity without changing functionality.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>
2026-04-28 19:23:44 +00:00
LyAhn 59d3280cb5 Merge pull request #4 from JezzWTF/jules-refactor-spinner-7897005482205256093
🧹 [Code Health] Extract duplicated SVG spinner into a shared component
2026-04-28 15:56:40 +01:00
google-labs-jules[bot] 2d2ab26994 🧹 [Code Health] Extract duplicated SVG spinner into a shared component\n\n🎯 What: Extracted the duplicated <svg> spinner code in web/components/GenerationControls.tsx into a new lightweight React component SpinnerIcon.\n💡 Why: This improves maintainability and keeps the code DRY by removing the inline duplication of the SVG path and properties.\n Verification: Ran pnpm install and pnpm run build in the web directory, confirming the code compiles successfully.\n Result: The isGenerating and !serverReady branches now cleanly reference the <SpinnerIcon /> component.
Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>
2026-04-28 14:53:41 +00:00
google-labs-jules[bot] bd5c667307 chore: refactor duplicated offline response in health api route
Extract the duplicated offline response payload and common headers into
constants to improve maintainability and readability.

- Define OFFLINE_RESPONSE for { status: "offline" }
- Define COMMON_OPTIONS for { headers: { "Cache-Control": "no-store" } }
- Use these constants across all response paths in the route.

Co-authored-by: LyAhn <27559362+LyAhn@users.noreply.github.com>
2026-04-28 14:17:19 +00:00
LyAhn 34ec879cdb feat: add studio roadmap and streaming cleanup 2026-04-28 00:09:15 +01:00