Why two modes?
DualMind offers two distinct chat modes serving different purposes:| Mode | Models | Use Case | Voting |
|---|---|---|---|
| Single Chat | 1 model | Quick AI responses | No |
| Dual Chat | 2 models | Yes |
Single Chat
Purpose
Single chat provides a straightforward AI inference endpoint. Send a prompt, receive a response. Use Cases:- Building chatbots with consistent model choice
- Testing specific model behavior
- Production applications requiring predictable responses
- Conversations where model identity matters
How It Works
Characteristics
| Aspect | Behavior |
|---|---|
| Response time | ~1-3 seconds typical |
| Model choice | Explicit or random |
| Database writes | Message logged if threadId provided |
| Streaming support | Yes (via SSE endpoint) |
| Parallel execution | No (single model) |
Single chat is the foundation. Dual chat builds on this by running two parallel single-chat executions.
Dual Chat (Arena Mode)
Purpose
Dual chat compares two models with the same prompt under identical conditions. Users vote on which response is better, creating comparative quality data. Use Cases:- Benchmarking model quality
- Collecting user preferences
- Building model leaderboards
- Running blind comparisons (users don’t see model names until after voting)
How It Works
Selection Modes
- Random
- Topper
- Manual
Mode:
randomSelects two different models randomly from active model pool.Why use this?- Unbiased comparisons
- Discovering unexpected model differences
- Equal exposure for all models
- Building diverse comparison dataset
Parallel Execution
Both models execute simultaneously, not sequentially. Performance Benefit:Arena Verdict
The system automatically computes a comparison verdict:| Metric | Calculation |
|---|---|
| Winner by length | Model with longer response text |
| Winner by tokens | Model with higher completion token count |
| Verdict text | Human-readable summary |
“Agent 2 (Mixtral) provided a slightly longer response with more detailed explanations”
Automatic verdict is informational only. User votes determine actual winner for statistics.
Key Differences
| Feature | Single Chat | Dual Chat |
|---|---|---|
| Models executed | 1 | 2 |
| Execution | Sequential (with fallback) | Parallel |
| Comparison ID | None | Generated UUID |
| Voting support | No | Yes |
| Response structure | ||
| Performance | Faster (1 model) | Slower (2 models) but parallelized |
| Database writes | 1 message | 2 messages + 1 comparison |
When to Use Each Mode
Choose Single Chat When:
- Building a chatbot with consistent model behavior
- Model identity is known and important
- Minimizing latency (faster than dual-chat)
- User doesn’t need to compare models
- Streaming response (SSE) is priority
Choose Dual Chat When:
- Quality comparison is the goal
- Collecting user votes on model preference
- Building leaderboards or benchmarks
- Running blind tests (hide model names initially)
- Research requires comparative data
Streaming Considerations
Single Chat: Full streaming support via SSE endpoint Dual Chat: No streaming support currently Why no dual-chat streaming?- Complexity: Two parallel SSE streams harder to manage client-side
- Use case: Arena comparisons typically need full responses for fair comparison
- Future: Could support if use case emerges
For long prompts in dual-chat, consider using single-chat SSE endpoint twice sequentially if streaming is needed.
Database Persistence
Single Chat Writes
IfthreadId provided:
- 1 row in
thread_messagestable - Model response, prompt, timing stored
- Links to thread for conversation history
Dual Chat Writes
Always writes:- 1 row in
comparisonstable (comparison ID, both models, responses, timing) - 1 row in
thread_messages(ifthreadIdprovided) - Links message to comparison via
comparison_idforeign key
Model Selection Transparency
Single Chat
Model name returned in response. User always knows which model generated response.Dual Chat
Models identified as “agent1” and “agent2” in response. Model names included, enabling:- Revealed Arena: Show model names immediately
- Blind Arena: Hide names until after vote (client-side logic)
Next Steps
Model Selection
How models are chosen for inference
Voting System
How user votes affect statistics
Streaming Protocol
SSE implementation for single chat
Thread Management
Persisting conversations