A lightweight, CPU-friendly GPT-style conversational AI built from scratch in PyTorch. Trained on a curated mix of instruction-tuning and identity datasets, it runs locally with no cloud dependencies.
This launches an interactive terminal session. Type quit or exit to end, clear to reset the conversation.
Quick Start — Web Chat
bash
1# Terminal 1: start the API server2python api_server.py --host 127.0.0.1 --port 8765 --api-key your-secret-key
34# Terminal 2: open the web client5# Open web/index.html in a browser (or serve it)6python -m http.server 8080 --directory web
7# Then visit http://localhost:8080
API Key Authentication
The API server supports optional API key authentication. When enabled, all POST endpoints (/chat, /generate) require the key in the X-API-Key header.
Setting the API key:
bash
1# Via command line2python api_server.py --api-key my-secret-key
34# Via environment variable5exportTELLY_API_KEY=my-secret-key
6python api_server.py
78# Auto-generate a key (first run creates .api_key file)9python api_server.py
Generating a new key at runtime:
curl -X GET http://127.0.0.1:8765/api-key -H "X-API-Key: <existing-key>"
API Endpoints
Method
Endpoint
Auth Required
Description
GET
/health
No
Health check; returns model loaded state
GET
/api-key
Yes
Generate a new API key
POST
/generate
Yes
Complete a prompt
POST
/chat
Yes
Conversational chat
/generate body:
{ "prompt": "Hello, who are you?", "max_tokens": 256, "temperature": 0.8, "top_p": 0.9 }
Telly Oasis 1 supports four dataset formats (auto-detected by file extension):
Extension
Format
Description
.json
JSON
A JSON array of conversation objects
.jsonl
JSONL
One JSON object per line
.md
Markdown
Conversations separated by ---, with ### role headings
.txt
Plain Text
Pairs of lines treated as human/gpt turns
JSON / JSONL Format
json
1{"conversations":[2{"from":"system","value":"You are Telly Oasis AI."},3{"from":"human","value":"Hello"},4{"from":"gpt","value":"Hello! How can I help?"}5]}
Valid roles: system, human, gpt.
Markdown Format
markdown
1### System2You are Telly Oasis AI.
34### Human5Hello
67### Assistant8Hi there!
910---1112### Human13What can you do?
1415### Assistant16I can help with coding, math, reasoning, and more.
Supported role headings: System, Human, Assistant, GPT, gpt.
Preparing Your Own Dataset
1. Convert OpenOrca parquet files
python convert_and_merge.py
This reads datasets/OpenOrca/*.parquet and datasets/ultrachat_200k/data/*.parquet, converts them to the project JSONL format, merges them with the identity dataset, deduplicates, and writes datasets/telly-oasis-1.jsonl.
2. Generate the identity dataset
python generate_identity.py
This creates datasets/identity.jsonl with self-introduction Q&A pairs about Telly Oasis 1 and its creator Ahmad Asif Khan.