Zerplexity is an open‑source internet searching agent that pairs gpt4o support with a Jinai re‑ranker to deliver high‑quality, citation‑rich chat responses. It features a Train Mode for collecting pairwise feedback to fine‑tune reranking, and a Production Mode for real‑time, reranked interactions.
Python
1
12 commits
updated Jul 20, 2025
Zerplexity is a next-generation internet search assistant that combines cutting-edge AI models with sophisticated training data collection to deliver high-quality, citation-rich responses. Built as a comprehensive framework for real-time model evaluation and fine-tuning in production environments.
Zerplexity is not just another search assistant—it's a comprehensive research framework designed for AI practitioners, researchers, and organizations who want to:
Production Mode: Optimized single-response generation for real-world usage
Training Mode: Side-by-side model comparison for continuous improvement
Response Generation Models:
Query Processing Models:
Retrieval & Ranking:
Model Comparison Data:
{
"query": "How does quantum computing work?",
"response1": { "text": "...", "latency": 2.14, "tokens_per_minute": 1420, "temperature": 0.3 },
"response2": { "text": "...", "latency": 2.18, "tokens_per_minute": 1380, "temperature": 0.7 },
"selected_response": 1
}
Query Rewriting Training Data:
Reranker Training Data:
Users can toggle between:
| Model | Avg Latency | TTFT | Tokens/Min | Notes |
|---|---|---|---|---|
| GPT-4o Mini | 2.1-2.9s | 0.5-1.3s | 1,400-4,500 | Consistent performance |
| Llama 80B* | 3.0-5.0s | 2.0-3.0s | 800-1,200 | Limited by endpoint |
Traditional search assistants are black boxes—you can't easily:
Zerplexity bridges this gap by providing a complete research platform that enables:
Perfect for: AI researchers, ML engineers, organizations building custom search solutions, and anyone interested in advancing the state-of-the-art in AI-powered information retrieval.
Note: Due to budget constraints, the Llama 80B model is currently hosted on a limited SageMaker endpoint, which affects its latency and throughput performance. In an optimized deployment with proper hardware allocation, Llama 80B with speculative decoding would achieve significantly better performance metrics.
graph TB
subgraph "Frontend Layer"
UI[React Frontend]
API[API Client]
end
subgraph "Backend Core"
FastAPI[FastAPI Server]
Stream[Streaming Engine]
CORS[CORS Middleware]
end
subgraph "AI Models"
GPT4O[GPT-4o Mini]
Llama[Llama 80B + Speculative Decoding]
T5[T5 Query Reformulation]
Reranker[Jina Reranker v1 Turbo]
end
subgraph "Search Infrastructure"
Brave[Brave Search API]
Scraper[Web Content Scraper]
Chunker[Content Chunking]
end
subgraph "Training Pipeline"
Collector[Training Data Collector]
Storage[S3/Local Storage]
Scripts[Fine-tuning Scripts]
end
subgraph "Cloud Infrastructure"
Vercel[Vercel Frontend]
Render[Render Backend]
SageMaker[AWS SageMaker]
S3[AWS S3 Buckets]
end
UI --> API
API --> FastAPI
FastAPI --> Stream
FastAPI --> GPT4O
FastAPI --> Llama
FastAPI --> T5
FastAPI --> Reranker
FastAPI --> Brave
Brave --> Scraper
Scraper --> Chunker
FastAPI --> Collector
Collector --> Storage
Storage --> Scripts
Vercel -.-> Render
Render -.-> SageMaker
Storage -.-> S3
prhegde/t5-query-reformulation-RLjinaai/jina-reranker-v1-turbo-en# Web scraping with readability optimization
async def fetch_clean_text(client: httpx.AsyncClient, url: str) -> str:
html = Document(r.text).summary() # Extract main content
text = BeautifulSoup(html, "lxml").get_text(" ", strip=True)
return text[:MAX_CHARS_PER_PAGE]
# Intelligent chunking with overlap
def split_into_chunks(text: str, max_chars: int = 800, overlap: int = 120):
chunks, start = [], 0
while start < len(text):
end = start + max_chars
chunks.append(text[start:end])
start = end - overlap
return chunks
training_data.json){
"query": "How is climate change affecting polar bears?",
"response1": {
"text": "Climate change is significantly impacting polar bears...",
"temperature": 0.3,
"latency": 2.14,
"tokens_per_minute": 1420.5
},
"response2": {
"text": "Polar bears face unprecedented challenges due to warming...",
"temperature": 0.7,
"latency": 2.14,
"tokens_per_minute": 1380.2
},
"selected_response": 1,
"sources": [/* ranked sources */]
}
query_rewriting_training_data.json){
"original_query": "climate change polar bears",
"selected_sources": ["https://www.nature.com/articles/...", "..."],
"query_source_mapping": {
"How is climate change affecting polar bear populations in the Arctic?": {
"sources": [/* sources from this query */],
"reasoning": "GPT-4o generated query"
}
},
"query_generator": "gpt4o"
}
reranker_training_data.json){
"query": "climate change polar bears",
"all_sources": [/* all retrieved sources */],
"positive_sources": [/* user-selected top 3 URLs */],
"negative_sources": [/* remaining source URLs */]
}
models_finetuning/train_reranker.py)models_finetuning/train_query_rewriting.py)// Streaming response handling with type-based routing
for await (const evt of await askStream(q, mode, model, count, training, queryGenerator)) {
switch(evt.type) {
case 'sources':
// Immediate source display for citation preparation
updateSources(evt.data);
break;
case 'query_generation':
// Store query mapping for training data
storeQueryGeneration(evt);
break;
case 'token':
// Real-time response streaming
appendToken(evt.value, evt.response);
break;
case 'training_comparison':
// Side-by-side model comparison
displayComparison(evt);
break;
}
}
http://localhost:8000)https://zerplexity-5.onrender.com)FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE $PORT
CMD uvicorn app:app --host 0.0.0.0 --port $PORT
Features:
{
"builds": [
{
"src": "package.json",
"use": "@vercel/static-build",
"config": { "distDir": "dist" }
}
]
}
Features:
# Abstracted storage with S3 fallback to local
def save_json(key, data):
if S3_BUCKET:
s3.put_object(Bucket=S3_BUCKET, Key=key, Body=json.dumps(data))
else:
Path(key).parent.mkdir(parents=True, exist_ok=True)
with open(key, 'w') as f:
json.dump(data, f, indent=2)
cd backend
pip install -r requirements.txt
cp .env.example .env
# Configure API keys
uvicorn app:app --reload
cd frontend
npm install
cp .env.example .env.local
# Configure API endpoint
npm run dev
# Backend
BRAVE_API_KEY=your_brave_api_key
OPENAI_API_KEY=your_openai_key
RERANKER_MODEL=jinaai/jina-reranker-v1-turbo-en
TRAINING_S3_BUCKET=your_s3_bucket # Optional
# Frontend
VITE_API_BASE_URL=http://localhost:8000 # Development
VITE_API_BASE_URL=https://your-backend.com # Production
MIT License - see LICENSE for details.
We welcome contributions!
Built with ❤️ for the future of AI-powered search and continuous model improvement.
Zerplexity is an open‑source internet searching agent that pairs gpt4o support with a Jinai re‑ranker to deliver high‑quality, citation‑rich chat responses. It features a Train Mode for collecting pairwise feedback to fine‑tune reranking, and a Production Mode for real‑time, reranked interactions.
Python
1
12 commits
updated Jul 20, 2025
Zerplexity is a next-generation internet search assistant that combines cutting-edge AI models with sophisticated training data collection to deliver high-quality, citation-rich responses. Built as a comprehensive framework for real-time model evaluation and fine-tuning in production environments.
Zerplexity is not just another search assistant—it's a comprehensive research framework designed for AI practitioners, researchers, and organizations who want to:
Production Mode: Optimized single-response generation for real-world usage
Training Mode: Side-by-side model comparison for continuous improvement
Response Generation Models:
Query Processing Models:
Retrieval & Ranking:
Model Comparison Data:
{
"query": "How does quantum computing work?",
"response1": { "text": "...", "latency": 2.14, "tokens_per_minute": 1420, "temperature": 0.3 },
"response2": { "text": "...", "latency": 2.18, "tokens_per_minute": 1380, "temperature": 0.7 },
"selected_response": 1
}
Query Rewriting Training Data:
Reranker Training Data:
Users can toggle between:
| Model | Avg Latency | TTFT | Tokens/Min | Notes |
|---|---|---|---|---|
| GPT-4o Mini | 2.1-2.9s | 0.5-1.3s | 1,400-4,500 | Consistent performance |
| Llama 80B* | 3.0-5.0s | 2.0-3.0s | 800-1,200 | Limited by endpoint |
Traditional search assistants are black boxes—you can't easily:
Zerplexity bridges this gap by providing a complete research platform that enables:
Perfect for: AI researchers, ML engineers, organizations building custom search solutions, and anyone interested in advancing the state-of-the-art in AI-powered information retrieval.
Note: Due to budget constraints, the Llama 80B model is currently hosted on a limited SageMaker endpoint, which affects its latency and throughput performance. In an optimized deployment with proper hardware allocation, Llama 80B with speculative decoding would achieve significantly better performance metrics.
graph TB
subgraph "Frontend Layer"
UI[React Frontend]
API[API Client]
end
subgraph "Backend Core"
FastAPI[FastAPI Server]
Stream[Streaming Engine]
CORS[CORS Middleware]
end
subgraph "AI Models"
GPT4O[GPT-4o Mini]
Llama[Llama 80B + Speculative Decoding]
T5[T5 Query Reformulation]
Reranker[Jina Reranker v1 Turbo]
end
subgraph "Search Infrastructure"
Brave[Brave Search API]
Scraper[Web Content Scraper]
Chunker[Content Chunking]
end
subgraph "Training Pipeline"
Collector[Training Data Collector]
Storage[S3/Local Storage]
Scripts[Fine-tuning Scripts]
end
subgraph "Cloud Infrastructure"
Vercel[Vercel Frontend]
Render[Render Backend]
SageMaker[AWS SageMaker]
S3[AWS S3 Buckets]
end
UI --> API
API --> FastAPI
FastAPI --> Stream
FastAPI --> GPT4O
FastAPI --> Llama
FastAPI --> T5
FastAPI --> Reranker
FastAPI --> Brave
Brave --> Scraper
Scraper --> Chunker
FastAPI --> Collector
Collector --> Storage
Storage --> Scripts
Vercel -.-> Render
Render -.-> SageMaker
Storage -.-> S3
prhegde/t5-query-reformulation-RLjinaai/jina-reranker-v1-turbo-en# Web scraping with readability optimization
async def fetch_clean_text(client: httpx.AsyncClient, url: str) -> str:
html = Document(r.text).summary() # Extract main content
text = BeautifulSoup(html, "lxml").get_text(" ", strip=True)
return text[:MAX_CHARS_PER_PAGE]
# Intelligent chunking with overlap
def split_into_chunks(text: str, max_chars: int = 800, overlap: int = 120):
chunks, start = [], 0
while start < len(text):
end = start + max_chars
chunks.append(text[start:end])
start = end - overlap
return chunks
training_data.json){
"query": "How is climate change affecting polar bears?",
"response1": {
"text": "Climate change is significantly impacting polar bears...",
"temperature": 0.3,
"latency": 2.14,
"tokens_per_minute": 1420.5
},
"response2": {
"text": "Polar bears face unprecedented challenges due to warming...",
"temperature": 0.7,
"latency": 2.14,
"tokens_per_minute": 1380.2
},
"selected_response": 1,
"sources": [/* ranked sources */]
}
query_rewriting_training_data.json){
"original_query": "climate change polar bears",
"selected_sources": ["https://www.nature.com/articles/...", "..."],
"query_source_mapping": {
"How is climate change affecting polar bear populations in the Arctic?": {
"sources": [/* sources from this query */],
"reasoning": "GPT-4o generated query"
}
},
"query_generator": "gpt4o"
}
reranker_training_data.json){
"query": "climate change polar bears",
"all_sources": [/* all retrieved sources */],
"positive_sources": [/* user-selected top 3 URLs */],
"negative_sources": [/* remaining source URLs */]
}
models_finetuning/train_reranker.py)models_finetuning/train_query_rewriting.py)// Streaming response handling with type-based routing
for await (const evt of await askStream(q, mode, model, count, training, queryGenerator)) {
switch(evt.type) {
case 'sources':
// Immediate source display for citation preparation
updateSources(evt.data);
break;
case 'query_generation':
// Store query mapping for training data
storeQueryGeneration(evt);
break;
case 'token':
// Real-time response streaming
appendToken(evt.value, evt.response);
break;
case 'training_comparison':
// Side-by-side model comparison
displayComparison(evt);
break;
}
}
http://localhost:8000)https://zerplexity-5.onrender.com)FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE $PORT
CMD uvicorn app:app --host 0.0.0.0 --port $PORT
Features:
{
"builds": [
{
"src": "package.json",
"use": "@vercel/static-build",
"config": { "distDir": "dist" }
}
]
}
Features:
# Abstracted storage with S3 fallback to local
def save_json(key, data):
if S3_BUCKET:
s3.put_object(Bucket=S3_BUCKET, Key=key, Body=json.dumps(data))
else:
Path(key).parent.mkdir(parents=True, exist_ok=True)
with open(key, 'w') as f:
json.dump(data, f, indent=2)
cd backend
pip install -r requirements.txt
cp .env.example .env
# Configure API keys
uvicorn app:app --reload
cd frontend
npm install
cp .env.example .env.local
# Configure API endpoint
npm run dev
# Backend
BRAVE_API_KEY=your_brave_api_key
OPENAI_API_KEY=your_openai_key
RERANKER_MODEL=jinaai/jina-reranker-v1-turbo-en
TRAINING_S3_BUCKET=your_s3_bucket # Optional
# Frontend
VITE_API_BASE_URL=http://localhost:8000 # Development
VITE_API_BASE_URL=https://your-backend.com # Production
MIT License - see LICENSE for details.
We welcome contributions!
Built with ❤️ for the future of AI-powered search and continuous model improvement.