Skip to content
Proyek

Tentang

AyushLM is a personal AI platform for Ayush Raj, built with verified knowledge, ai models Inference, and Cloudflare infrastructure.

Sistem dan infrastruktur

Cara angka ini diukur

61 bintang0 Fork +2 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+2
dalam 7 hari
Mengumpulkan riwayat
dalam 15 hari
Mengumpulkan riwayat
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

AyushLM Blue Glass logo

AyushLM

Centralized Personal Language Intelligence Platform
One identity. Unified intelligence. Verified knowledge. Natural conversations.

Upcoming v2.5.0 Continuous integration Production deployment Apache 2.0 Cloudflare React 19

Launch AyushLM · Portfolio AI · Developer API · Embedding guide · Privacy

v2.5.0 — Connected Intelligence & Unified Voice Experience (upcoming release). The embedded chat and integrated voice enhancements are merged into main and have passed owner production acceptance. The latest published release remains v2.0.0 — Unified Intelligence & Live Voice, published December 1, 2026. The canonical developer API model identifier remains ayushlm-v1.


Contents

Overview

AyushLM is a centralized, privacy-first AI application developed by Ayush Raj (ayushcmd) to make his verified personal knowledge, technical expertise, projects and academic journey accessible through natural conversations.

It combines deterministic fact retrieval, a structured Cloudflare D1 knowledge base, retrieval-augmented generation (RAG), multi-provider inference and native real-time voice. AyushLM is an intelligence orchestration platform built on existing foundation models, not an independently trained foundation model.

Its guiding principle is one intelligence engine, one chat interface, multiple websites. The standalone application, embedded portfolio experience and scoped Developer API all use the centralized gateway. Compatible improvements to the embedded interface are inherited by the portfolio on subsequent loads without a separate portfolio deployment.

What's new in v2.5.0

Enhancement Experience
Secure embedded mode A dedicated /embed route without sidebar, owner login, Studio or private knowledge access.
Connected portfolio AI The live portfolio /ai hosts the canonical AyushLM interface instead of maintaining a duplicate chat application.
Arrival voice consent Visitors choose Enable Voice or Continue with Text before microphone capture or a Live Voice connection.
Native spoken welcome A server-controlled Gemini Live greeting introduces AyushLM and its creator after consent and connection.
Unified voice and text A reactive central voice orb above the composer, transitioning to a compact dock during active text conversations.
Voice reliability Startup cancellation, stale-session isolation, duplicate-start prevention, playback unlocking, delayed-audio suppression and resource cleanup.
Theme synchronization Blue Glass and Pearl Glass themes synchronized with the approved parent website without reloading the iframe.
Lightweight integration The portfolio refactor removed a net 2,037 lines in its iframe refactoring commit; no portfolio-side inference proxy or developer API key is needed.

Implementation: Secure embedding — PR #28, Integrated voice — PR #29, Portfolio integration — PR #37.

Live applications

Surface Address Purpose
Standalone AyushLM ayushlm.pages.dev Full public chat and dedicated Live Voice experience
Portfolio AI www.ayushcmd.me/ai Integrated voice and text assistant
Embedded application ayushlm.pages.dev/embed Isolated public-only chat and inline voice
Owner Studio ayushlm.pages.dev/studio Authenticated management and diagnostics
Gateway https://ayushlm-api.ayushcmd08.workers.dev Centralized API and voice relay
Pages API proxy https://ayushlm.pages.dev/api Same-origin service binding

The legacy portfolio /kiro route permanently redirects to /ai.

Application previews

Connected Intelligence — embedded experience

The following captures are from the cross-origin development verification harness. Voice and streaming were mocked for these captures; they are not presented as live production screenshots.

Arrival voice permission Integrated Live Voice
Voice consent dialog Integrated voice orb
Embedded Blue Glass Embedded Pearl Glass
Embedded dark theme Embedded light theme
Active conversation Mobile embedded layout
Active embedded chat Mobile embedded chat

Standalone application and Owner Studio

These v2.0 previews include production captures, browser-emulated mobile layouts and sanitized Studio demonstrations.

Blue Glass Pearl Glass
Standalone dark theme Standalone light theme
Standalone Live Voice Owner Studio
Live Voice Studio overview

Architecture

One centralized platform

flowchart TB
    Visitor[Public visitor] --> Full[Standalone AyushLM]
    Visitor --> Portfolio[Portfolio /ai — Next.js on Vercel]
    Portfolio -->|Restricted iframe| Embed[AyushLM /embed]
    Owner[Authenticated owner] --> Studio[Owner Studio]
    Full --> Pages[Cloudflare Pages /api proxy]
    Embed -->|Public-only routes| Pages
    Studio --> Pages
    Pages -->|AYUSHLM_API service binding| Gateway[Hono Worker Gateway]
    Dev[External application] -->|Scoped API key| Gateway
    Gateway --> Security[Authentication, rate limits and privacy gates]
    Security --> Engine[Unified intelligence and voice relay]
    Engine --> D1[(D1 knowledge, counters and leases)]
    Engine --> Groq[Groq GPT-OSS]
    Engine --> Gemini[Gemini text fallback]
    Engine <-->|Native audio| Live[Gemini Live]

Text intelligence

flowchart LR
    Q[Chat request] --> P[Intent and privacy classification]
    P -->|Verified fast path| D[Deterministic answer or abstention]
    P -->|Personal knowledge| K[D1 retrieval within caller scope]
    P -->|General conversation| R[Provider routing]
    K --> R
    R --> G[Groq primary]
    G -->|Eligible fallback before visible output| F[Gemini Flash-Lite]
    D --> O[JSON or SSE response]
    G --> O
    F --> O

Embedded Live Voice lifecycle

flowchart TD
    A[Visitor opens /embed] --> C{Voice consent}
    C -->|Continue with Text| T[Normal text chat]
    C -->|Enable Voice| M[Browser microphone permission]
    M -->|Denied or unavailable| T
    M -->|Granted| W[Public voice WebSocket]
    W --> L[D1 leases and quota gate]
    L --> G[Gemini Live connection]
    G --> I[Server-controlled native introduction]
    I --> V[Inline voice orb and text composer]
    V -->|Typed turn| P[Pause mic forwarding and suppress old audio]
    P --> V
    V -->|End voice or page exit| E[Release microphone, audio contexts and socket]
    E --> T

Intelligence and knowledge

Role Model / component Policy
Deterministic retrieval AyushLM rule engine and D1 Verified facts, security refusals, and explicit abstention
General conversation & reasoning gemini-3.8-flash (Google Gemini) General chat & reasoning; personal knowledge sharing disabled by default (GEMINI_FREE_TIER_VERIFIED="false" gate until upstream capacity & quota verification)
Personal synthesis & analysis openai/gpt-oss-120b (Groq) Owner-approved public knowledge synthesis, project ranking, and evaluation
Independent fallback @cf/zai-org/glm-4.7-flash (Cloudflare Workers AI) Native [ai] binding (10,000 free neurons/day); personal knowledge disabled by default
Native voice gemini-3.8-live Consented voice and authorized public knowledge
OpenRouter / Legacy Adapters retained Disabled and deferred

The shared intelligence engine supports English, Hindi and Hinglish, deterministic identity and fact answers, context-aware RAG, provider-specific privacy gates and bounded fallback. Optional multi-model collaboration remains disabled by default.

Knowledge ingestion uses heading-aware Markdown parsing, SHA-256 content hashing, multilingual aliases and topical retrieval filtering. The documented v2.0 knowledge snapshot contained 99 structured records, 699 tags, 1,160 aliases and 38 tracked projects. These are historical verification figures, not a live database counter.

AyushLM Live

AyushLM Live provides bidirectional native audio through a server-mediated WebSocket connection:

  • 16 kHz PCM microphone input and 24 kHz PCM audio playback.
  • Natural barge-in, mute/unmute, reactive RMS-driven orb and optional ephemeral captions.
  • Public-only lookup_public_knowledge tool and server-held provider credentials.
  • Consent before microphone access, with a text-only alternative.
  • Safe teardown on session end, cancellation, unmount and page exit.

In embedded mode, visitors can hear a native greeting introducing AyushLM as a personal AI assistant developed by Ayush Raj. The greeting is a fixed server-controlled request to Gemini Live; exact generated speech is not guaranteed. The application records the greeting as played after audio is successfully scheduled, preventing replay in the same visitor session where browser session storage is available. The integrated composer remains accessible while voice is active.

Text and voice use coordinated but separate inference turns; the implementation does not imply a single shared provider conversation transcript across both modalities.

Embedded mode and portfolio integration

The /embed route reuses the canonical application while excluding the sidebar, conversation history navigation, owner authentication and Studio. Embedded chat state stays in memory and does not read or write standalone owner or guest conversation history.

<iframe
  src="https://ayushlm.pages.dev/embed?theme=dark"
  title="AyushLM AI"
  allow="microphone"
  referrerpolicy="strict-origin-when-cross-origin"
  style="display:block;width:100%;height:100%;border:0"
></iframe>

Give the parent container an explicit responsive height. The default production framing allowlist is restricted to https://www.ayushcmd.me and https://ayushcmd.me; arbitrary sites and ordinary Vercel preview origins are not authorized. Any temporary test origins must be explicitly configured and narrowly scoped. Standalone and privileged documents deny framing.

Where the parent has a microphone permissions policy, delegate access to the embedded origin:

Permissions-Policy: microphone=(self "https://ayushlm.pages.dev")

Use the iframe's initial theme parameter and send subsequent theme changes without changing its src:

iframe.contentWindow?.postMessage(
  { type: 'ayushlm:theme', theme: 'light' },
  'https://ayushlm.pages.dev'
);

The receiver checks the exact parent origin, source window, message structure and allowed theme value (dark, light, system). No credentials or transcripts are exchanged. See the embedding guide for the integration contract and browser restrictions.

Dedicated gateway paths enforce public scope even if owner credentials are present. The Pages proxy strips Cookie and Authorization on these paths:

Method Gateway path
POST /v1/public/chat/completions
GET /v1/public/voice/status
WebSocket /v1/public/voice/ws

The browser accesses these paths through the same-origin /api prefix. The portfolio does not need an API key, duplicate SSE parser, inference proxy or separate voice implementation.

Developer API

Scoped API keys remain available for custom external applications requiring their own interfaces. The stable OpenAI-compatible text contract uses POST /v1/chat/completions and ayushlm-v1.

curl https://ayushlm-api.ayushcmd08.workers.dev/v1/chat/completions \
  -H "Authorization: Bearer $AYUSHLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"ayushlm-v1","messages":[{"role":"user","content":"Tell me about Ayush Raj’s projects."}],"stream":false}'

Use a server-side public:read key for public integrations. Never expose credentials in browser JavaScript. The example assumes an environment variable containing an authorized key. Streaming is available with stream: true. The Developer API does not automatically provide the official voice UI; use authorized embedding for that experience.

Owner Studio

The authenticated control plane provides Overview, Knowledge, Datasets & Sync, Developer API Keys, Playground, Analytics, Evaluations, System Diagnostics and Settings. Studio and owner controls are excluded from embedded mode. Existing Blue Glass and Pearl Glass themes, local conversation persistence for standalone chat, responsive scrolling and reduced-motion support are retained.

Privacy and security

  • Public/private isolation: D1 visibility filtering and gateway scope checks enforce private knowledge boundaries. Private records are not authorized for external model sharing.
  • Embedded isolation: Dedicated routes force anonymous public scope, regardless of owner session cookies or bearer credentials. The iframe does not depend on third-party cookies.
  • Framing protection: Exact approved origins for /embed; frame-ancestors 'none' and X-Frame-Options: DENY for other document routes.
  • Credentials: Provider secrets remain server-side; owner authentication uses PBKDF2-HMAC-SHA512 and API keys are stored as hashes.
  • Storage: Standalone text conversations use browser-local IndexedDB. Embedded conversations are temporary. The application does not permanently store raw voice recordings or voice transcripts.
  • Provider disclosure: Gemini Free Tier may use submitted audio and relevant context to improve its products. Visitors should not share sensitive information.

Read PRIVACY.md, SECURITY.md and BRANDING.md for details. Repository visibility and public-readiness are separate owner decisions; the licensing of eligible files does not imply the repository is publicly accessible.

Technology stack

Layer Technology
Web application React 19, TypeScript, Vite 6, Tailwind CSS, Lucide
Gateway Hono, TypeScript, Zod, Cloudflare Workers
Hosting Cloudflare Pages, Pages Functions service binding
Data Cloudflare D1 / SQLite, browser IndexedDB
Inference Groq GPT-OSS, Gemini text and Live
Voice Web Audio API, AudioWorklet with fallback, WebSockets
Portfolio host Next.js on Vercel, restricted iframe
Quality Vitest, Python unittest, Playwright, GitHub Actions
AyushLM/
├── apps/
│   ├── gateway/        # Intelligence, authentication, API, voice relay
│   └── web/            # Standalone UI, embed UI, Studio, Pages proxy
├── asset/              # Branding and standalone previews
├── data/               # Public evaluation schemas and fixtures
├── docs/developers/    # API and embedding documentation
├── integrations/       # Widget and reference API clients
├── labs/               # Evaluation and benchmarking
├── plan-docs/          # Architecture decisions, reports and screenshots
├── scripts/            # Setup, verification and CI/CD tooling
├── study-lm/           # Engineering learning documentation
├── tests/              # Python regression tests
└── .github/workflows/  # CI and production deployment

Local development

Use Node.js 22 and Python 3.11, matching CI. From the repository root in PowerShell:

npm ci
Copy-Item .env.example apps/gateway/.dev.vars
# Configure authorized local credentials; never commit .dev.vars.
npm run d1:migrate:local

Run the gateway and web frontend in separate terminals:

npm run gateway:dev
npm run dev --workspace=apps/web

Run verification:

npm test --workspace=apps/gateway
npm test --workspace=apps/web
python -m unittest discover -s tests -v
npm run typecheck --workspace=apps/gateway
npm run typecheck --workspace=apps/web
npm run build --workspace=apps/web
npx wrangler pages functions build apps/web/functions
npm audit --omit=dev --audit-level=high

Use scripts/verify_embed_mode.mjs for controlled cross-origin browser verification. Local and preview origins cannot ordinarily frame the production application.

Verification and performance

Automated regression suite Latest reported passing count
Gateway Vitest 115 / 115
Web Vitest 41 / 41
Python unittest, including CI/CD policy 32 / 32
Total 188 / 188

The final PR #29 CI run passed. The preceding integrated voice harness reported 14/14 responsive checks across dark/light themes using mocked streaming, WebSocket and fake media input. The portfolio separately reported 39/39 tests and eight responsive checks. Owner production acceptance has been confirmed for both applications, including the integrated voice experience. Automated mocks are not evidence of physical microphone or native audio behaviour on every browser.

Latest reported final web build: approximately 425.81 kB uncompressed JavaScript and 36.46 kB CSS. The immediately preceding reliability build measured 116.35 kB gzipped JavaScript and 7.74 kB gzipped CSS. These are build measurements, not network latency or service-level guarantees. The most recent reported production-dependency audit found zero vulnerabilities; the full development-dependency audit is not claimed to be vulnerability-free.

Deployment and operating limits

flowchart LR
    A[Merge to main] --> CI[Tests and build validation]
    CI -->|Pass| P[Exact-SHA deployment plan]
    CI -->|Fail| X[Block deployment]
    P --> D[Change-aware Worker and Pages deployment]
    D --> S[Mandatory production smoke checks]
    S -->|Pass| OK[Production success]
    S -->|Fail| R[Controlled recovery / rollback]

GitHub Actions automatically deploys verified main commits through the protected production environment, with cumulative target change detection, configuration validation, deployment concurrency and recovery safeguards. Release tags and GitHub releases remain manually controlled. The deployment runbook documents operations and recovery.

AyushLM targets $0/month by operating within approved free-tier allowances; actual costs and availability depend on provider policies and usage.

Live Voice safeguard Effective limit
Session starts 5/minute, 90/day
Accounted input tokens 45,000/minute, 90,000/day
Concurrent sessions 1 global, 1 per visitor
Session duration 300 seconds
Speech inactivity timeout 30 seconds
Shared D1 lease 90-second TTL, 25-second renewal

Known limitations include shared provider quotas, browser microphone/autoplay policies, restricted iframe storage and clipboard access, and provider availability. In restricted browsers the app offers text chat or an Open Full AyushLM alternative. Session-based greeting suppression may reset on reload if session storage is unavailable. OpenRouter and optional collaboration remain disabled. Live rollback failure paths were tested with controlled fixtures rather than deliberate production disruption.

Release history

Version Milestone Status
v1.0.0 Foundation: verified knowledge, Studio, Developer API Published Nov 25, 2026
v1.5.0 Blue Glass Experience Published Nov 28, 2026
v2.0.0 Unified Intelligence & Live Voice; automatic CI/CD Published Dec 1, 2026
v2.5.0 Connected Intelligence & Unified Voice Experience Upcoming release; enhancements merged and owner accepted

See CHANGELOG.md and ROADMAP.md for implementation history and planned work.

Documentation, license and author

Contributing · Code of Conduct · Security · Support · Privacy · Citation

Eligible original software and technical documentation are licensed under the Apache License, Version 2.0. Official branding, personal likeness, personal datasets and other explicitly excluded assets are not covered by that license. See LICENSE, NOTICE, BRANDING.md and THIRD_PARTY_NOTICES.md. External foundation models and services are subject to their own terms.

Ayush Raj (ayushcmd) — Creator, Developer and Architect of AyushLM. B.S. in Computer Science and Data Analytics, Indian Institute of Technology Patna (IIT Patna).

GitHub · LinkedIn · Portfolio · Contact


One identity. Unified intelligence. Verified knowledge. Natural conversations.

Launch AyushLM · Experience Portfolio AI

Jelajahi proyek terkait

Memuat…