Debaite Technical Documentation
Debaite is an automated dialectical and adversarial reasoning engine, designed to test the strength of arguments, detect logical biases and synthesise balanced analyses with free open models (NVIDIA Nemotron through OpenRouter, Z.ai GLM as a fallback).
1. Dialectical Architecture
Rather than plain one-sided text generation, Debaite orchestrates two autonomous instances bound by strict rhetorical rules:
- Thesis Speaker (PRO): Develops the main proposition, building on verifiable facts and formal premises.
- Antithesis Speaker (CONTRA): Actively looks for logical flaws, counter-examples and blind spots in the opposing side.
- Synthesis & Judge: Assesses the formal validity of the arguments exchanged and produces a structured convergence report.
2. Model Integration
The PHP backend calls OpenRouter's OpenAI-compatible API and tries up to three free models in order, moving on to the next when one has written nothing after 12 seconds; as a last resort, it calls Z.ai's (GLM-4.5-Flash). The server writes each instruction itself from the topic and the step, adds its rules (no invented sources or figures, a respectful tone) and extracts of Wikipedia articles on the topic, the only precise sources the speakers may cite. The keys stay on the server:
POST https://openrouter.ai/api/v1/chat/completions
Headers:
Authorization: Bearer OPENROUTER_API_KEY
content-type: application/json
Payload:
{
"model": "nvidia/nemotron-3-ultra-550b-a55b:free",
"max_tokens": 1920,
"messages": [
{ "role": "system", "content": "You are Speaker A in a high-level adversarial debate..." },
{ "role": "user", "content": "Topic: Is accelerating general AI beneficial?" }
]
}
3. Internal API Reference: POST /debaite/api/generate.php
Endpoint: https://julienpiron.fr/debaite/api/generate.php
Each call produces a single speech. The Debaite page chains the eight speeches of the debate (opening, argument, rebuttal and closing for each side); the server writes the instruction for each one.
Headers: Content-Type: application/json, X-Debaite-CSRF (session token, returned by GET /debaite/api/session) and X-Debaite-Device (random device identifier, used for the public trial).
Body (JSON, 64 KiB at most):
subject(text, required): the debate topic, 300 characters at most.step(integer, required): the step, from0(opening of the affirmation) to7(closing of the contradiction).lang(text):fr(default) oren.opponent(text): for the rebuttals (steps4et5), the opposing argument, 3,000 characters at most.debateId(text): debate identifier, 16 to 80 hexadecimal characters or hyphens; required unless access is unlimited.mode(text):fast(default),think,expertorexpert_think.stream(boolean):trueto receive the speech as it is written.
Response: 200 with text (the speech), access (access status) and sources (title and link of the Wikipedia articles provided). With stream, the response is an event stream (text/event-stream): pieces of delta, then a final done event that repeats status and these same fields. If the AI returns nothing, the status is 502 et code is empty_reply. On error, error (message), sometimes code (for example csrf, google_required, trial_exhausted, credits_required, upstream_error) and access. If the AI service fails, the trial step or the credits used are refunded.
Google sign-in is required: each account gets one trial debate in fast mode; the other modes are reserved for access granted by Julien Piron, as no credits are sold.
4. Project Status
Debaite is a free, non-commercial personal demonstration project. No subscription or payment is offered.