# AI and LLM experiments

> One chat UI over several OpenAI-compatible gateways, Whisper and Qwen tests through Bytez, and a React sandbox used to rebuild and debug an admin page.

URL: https://thuyavan.netlify.app/projects/ai-llm-experiments
Updated: 2026-10-12

- Technologies: Python, FastAPI / Flask, LLM integration, React, TypeScript

## Inventory

#
Item
Path
Dates
Git
Size
Classification

A
Multi-provider LLM chat (Flask)
internal path
2025-11
no
app.py 181 + 2 test scripts + 2 templates + JS / CSS
B: small real app

B
Bytez SDK tests (Node / TS)
internal path
2025-11-17
no
6 TS files, 686 lines total
C: SDK evaluation

C
ai-test-1
internal path
2025-11-17
no
empty
EMPTY, omitted

D
Gemini CLI sandbox
internal path
2025-09-25
no
empty
EMPTY, omitted

## A. Multi-provider LLM chat (Flask)

What it does: one small web UI that talks to several hosted-LLM gateways behind the same chat page, so models can be compared side by side.

Layer
Detail

Back end
Flask app.py. Routes: / (provider picker, home.html), /chat/<provider> (chat page, index.html) with provider ∈ {agentrouter, bytez, openrouter}, POST /api/chat (JSON in / JSON out)

Providers
OpenRouter and AgentRouter via requests.post(<base>/chat/completions) (OpenAI-compatible schema); Bytez via the bytez Python SDK (handle_bytez)

Front end
static/script.js (fetch to /api/chat, renders the message list), static/style.css

Tools
check_openrouter_models.py (lists available / free OpenRouter models), test_bytez.py (SDK smoke test)

Packages
flask (web), requests (HTTP to OpenAI-compatible APIs), python-dotenv (keys from .env), bytez (Bytez SDK), pypdf (PDF text extraction for document chat)

Pattern: a provider-adapter switch (one handler per provider, same response shape back to the UI). This is the same idea as an LLM gateway / router.

## B. Bytez SDK tests (TypeScript)

Packages: bytez.js ^1.1.18 (Bytez model-hosting SDK), dotenv ^17 (keys).

File
Purpose

index.ts
basic text-model call

chat-cli.ts
terminal chat loop; history kept in chat_history.json

qwen.ts
Qwen model test

run-local.ts / run-path.ts / run-stream.ts
speech-to-text with openai/whisper-large-v3, tested three ways: local file, file path, and fs.createReadStream stream input; output saved to transcription.txt

This was an evaluation of Bytez as a cheap host for open models (LLM chat plus Whisper transcription). It fed directly into item A’s Bytez handler.

## E. React + shadcn test app

Vite + React 18 + TypeScript + Tailwind + shadcn/Radix (collapsible, dialog, slot), lucide-react, sonner, react-router-dom 6, CVA / clsx / tailwind-merge. prompt.txt shows the purpose: a clean sandbox to rebuild the RedWings admin “ApplicationDetailPage” (P10, 014) after a Babel parse error (Unexpected token (700:11)) in the real repo. Commits on 2025-11-27: “initial commit”, “logo loading”. Classification C: a debugging copy of RedWings UI, not a separate project; it is listed under P10’s duplicate set.
