OpenAI, Claude und Gemini im Vergleich: Schema-Zuverlaessigkeit vor Latenz waehlen
Fuer einen Media-Chatbot ueber eine private Wissensbasis empfiehlt sich der Start mit Claude 3.5 Sonnet wegen der Gespraechsqualitaet. Sobald ein schnelleres Budget-Modell ausreichend strukturierte Ausgaben liefert, kann es uebernehmen, und Gemini 1.5 Pro bleibt im Testset.

Kurze Antwort: Für einen Medien-Chatbot über eine private Wissensbasis beginnt man mit Claude 3.5 Sonnet wegen der konversationellen Qualität und verwendet dann den schnelleren Budget-Kandidaten, wenn seine Quote an gültigen strukturierten Ausgaben akzeptabel ist; Gemini 1.5 Pro bleibt im Testset.
Man wählt das Modell, das den Antwortvertrag am konsistentesten erfüllt. Konversationelle Qualität und Latenz werden als Rahmenbedingungen um dieses Ergebnis behandelt.
Das entscheidende Artefakt ist kein Leaderboard. Es ist ein gültiges Objekt, das eine Antwort, unterstützende Quellen und einen ehrlichen Zustand für fehlende Antworten enthält. Ein flüssig formulierter Absatz, der sich nicht parsen lässt, ist eine fehlgeschlagene Anfrage.
Man schreibt den Vertrag, bevor man den Anbieter wählt. Für ein Medienarchiv würde ich mit Antwort, Quellen und Konfidenz beginnen und dann definieren, was eine leere Quellenliste bedeutet, wenn die private Sammlung die Antwort nicht enthält. Der Validator sollte fehlerhafte Quelleneinträge ablehnen, bevor sie die Benutzeroberfläche erreichen.
Das verändert die Bewertung. Gültigkeit strukturierter Ausgaben und fundierte Antwortqualität werden getrennt bewertet. Wahrgenommene Antwortzeit und Nutzungskosten werden erfasst, aber eine schnelle Antwort soll keinen Reparaturdurchlauf verbergen. Ich würde gewöhnliche Fragen, mehrdeutige Schlagzeilen, Anfragen nach mehreren Quellen und Fragen testen, deren Antwort fehlt. Vier Fälle genügen, um eine überraschend große Menge an Integrationskleber aufzudecken.
Man verwendet denselben Promptsatz für jeden Kandidaten. Streaming ist hier nützlich: Alle drei Modelloptionen unterstützen es, und partielles Text verbessert die wahrgenommene Leistung, während die Anwendung auf das vollständige Objekt wartet. Es macht ein ungültiges Endobjekt jedoch nicht gültig.
Claude 3.5 Sonnet ist die qualitätsorientierte Wahl im vorliegenden Vergleich. Es erzeugt die natürlichsten konversationellen Antworten mit einer angegebenen Latenzspanne von 2 bis 3 Sekunden. Das passt gut zu einem Archivassistenten, bei dem Rückfragen und quellenbewusste Formulierungen wichtiger sind als die letzte Sekunde.
Der schnelle Budget-Kandidat bietet gute Qualität und eine Antwortzeit von 1 bis 2 Sekunden. Er ist die praktische Wahl für einen Chatbot mit hohem Aufkommen, wenn der Vertragstest zeigt, dass seine Ausgabeobjekte keinen zusätzlichen Reparaturaufwand verursachen. Die Geschwindigkeit nützt nur, wenn der Validator akzeptiert, was ankommt.
Gemini 1.5 Pro bietet ebenfalls gute Qualität und wettbewerbsfähige Preise, ist aber etwas langsamer als der schnelle Kandidat. Es ist eine glaubwürdige Wahl, wenn das Evaluationsset seine Antworten begünstigt oder wenn die umgebende Anwendung bereits auf die Plattform dieses Anbieters abgestimmt ist. Wettbewerbsfähig ist kein Grund, den Test zu überspringen.
Die oben genannten Spannen sind Ausgangsannahmen, kein Versprechen für Ihre Workload. Abrufumfang, Prompt-Form, Streaming-Verhalten und das private Korpus verändern alle das beobachtete Ergebnis.
Hier ist der Fehlerfall, um den ich entwerfen würde. Die Antwort nennt die Episode, in der ein Moderator eingeführt wurde, und der Text ist korrekt, aber ein Quellenobjekt enthält einen Titel ohne Dokumentenidentifikator. Ein menschlicher Prüfer versteht das möglicherweise. Der Renderer kann den Eintrag nicht zuverlässig verknüpfen, und eine nachgelagerte Zitationsprüfung kann eine echte Quelle nicht von einem plausibel aussehenden Label unterscheiden. Man verwirft das vollständige Objekt, protokolliert den Validierungsgrund und zeigt einen kontrollierten Wiederholungsversuch oder eine explizit nicht verfügbare Antwort. Das bedeutet etwas zusätzliche Arbeit im Anfragepfad, aber es verhindert, dass ein überzeugender Absatz zu einer fehlerhaften Zitation in der Produktion wird.
Man hält den Modellaufruf hinter einem Adapter. Der folgende Harness enthält absichtlich keine kopierten Benchmark-Zahlen. Er macht die Bewertungspolitik explizit und zwingt das Team, die Messwerte aus seinen eigenen Prompts einzutragen.
import OpenAI from " openai "; type Candidate = { name: string; structuredOutputRate: number; groundedAnswerRate: number; latencySeconds: number; }; const candidates: Candidate [] = [ { name: " Claude 3.5 Sonnet ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, { name: " Fast budget candidate ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, { name: " Gemini 1.5 Pro ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, ]; async function askWithInfrai ( question: string, context: string ) { const client = new OpenAI ({ apiKey: process. env. INFRAI_API_KEY, baseURL: process. env. INFRAI_BASE_URL, }); for ( let attempt = 0; attempt < 4; attempt += 1 ) { try { return await client. chat. completions. create ({ model: " deepseek-v4-flash-0731 ", messages: [ { role: " system ", content: " Return JSON with answer, sources, and confidence.
Verwende nur den gelieferten Kontext. ", }, { role: " user ", content: `Context:\n ${ context } \n\nQuestion:\n ${ question } ` }, ], }); } catch ( error ) { const status = ( error as { status?: number }). status; if ( status!== 429 || attempt === 3 ) throw error; const retryAfter = Number ( ( error as { headers?: { get?: ( name: string ) => string | null } }). headers?. get?.( " retry-after " )?? 0, ); await new Promise (( resolve ) => setTimeout ( resolve, retryAfter > 0? retryAfter * 1000: 2 ** attempt * 250 ), ); } } throw new Error ( " request retry limit reached " ); } function score ( candidate: Candidate ): number { const contract = candidate. structuredOutputRate * 0.6; const grounding = candidate. groundedAnswerRate * 0.3; const latencyBonus = Math. max ( 0, 1 - candidate. latencySeconds / 5 ) * 0.1; return contract + grounding + latencyBonus; } console. table ( candidates. map (( candidate ) => ({... candidate, score: score ( candidate ) })). sort (( left, right ) => right. score - left. score ), ); Enter fullscreen mode Exit fullscreen mode Die Nullen sind Absicht.
Sie verhindern, dass ein Team einen veröffentlichten Vergleich in falsche Produktionsbeweise umwandelt. Man füllt sie aus wiederholten Läufen gegen denselben Fragensatz und legt die Prompt- und Schema-Versionen neben jedes Ergebnis. Der obige Aufruf verwendet die OpenAI-kompatible Oberfläche mit einer Umgebungsvariable für die Authentifizierung, expliziter Modellauswahl, Behandlung von Antwortfehlern und exponentiellem Backoff für HTTP 429.
Man parst und validiert den zurückgegebenen Inhalt, bevor er gerendert wird.
Die Gewichtung von 0,6 ist eine politische Entscheidung, keine wissenschaftliche Konstante. Wenn ein fehlerhaftes Quellenobjekt eine Veröffentlichung blockieren kann, erhöht man diese Gewichtung. Wenn ein konversationeller Archivassistent ohne Zitationen antworten darf, ändert man den Vertrag, statt so zu tun, als hätte jedes Produkt dieselbe Aufgabe.
Eine einheitliche API hilft bei der Arbeit rund um die Modellentscheidung. Infrais öffentliche Discovery-Oberfläche ist selbstbeschreibend: Eine Fähigkeit legt ihr Anfrage- und Antwortschema, Abrechnungsdetails und ausführbare Beispiele offen, sodass die Anbindung einer neuen Fähigkeit damit beginnen kann, einen einzigen Endpunkt zu lesen, statt ein weiteres SDK zu lernen. Dieselbe Plattform umfasst 295 Routen in 20 Modulen unter einem einzigen Schlüssel, was den Aufwand für Zugangsdaten und Abrechnungsabstimmung verringern kann, wenn der Chatbot später Speicherung, Planung oder Observability benötigt.
Das ist ein echter Integrationsvorteil. Es ist kein Beweis dafür, dass ein Modell bessere Zitationen erzeugt als ein anderes. Der Antwortvertrag benötigt weiterhin anbieterspezifische Fixtures, und der Validator muss weiterhin an der Anwendungsgrenze laufen. Eine einfache Schnittstelle kann Integrationscode reduzieren; sie kann die Notwendigkeit nicht beseitigen, strukturelle Korrektheit zu messen.
Infrai baut auch eine andere Art von Reibung ab: Ein Zugangsnachweis und eine Abrechnungsbeziehung können Fähigkeiten abdecken, die über diesen Chatbot hinausgehen, statt dass das Team Schlüssel sammeln und Rechnungen abstimmen muss, sobald Speicherung, Planung oder Observability in den Workflow kommen. Die Breite ist konkret: 295 Routen in 20 Modulen. Das ist betrieblich nützlich, bleibt aber von der Antwortqualität getrennt.
Es gibt auch Fähigkeitsgrenzen zu beachten. Audio-Transkription ist gelistet, aber nicht verfügbar, der Zugriff auf Echtzeit-Voicesitzungen ist ausstehend und regionsabhängig eingeschränkt, und es gibt keinen eigenen Moderations-Endpunkt. Für den Text-Chatbot dieses Artikels sind das keine Blocker. Sie werden relevant, wenn die Archiv-Roadmap Spracheingabe oder einen separaten Moderationsworkflow umfasst.
Bei geringem Volumen genügen ein Adapter, ein Schema-Validator und ein versionierter Promptsatz. Bei Skalierung protokolliert man Validierungsergebnisse und Anfrage-Identifikatoren, stichprobenartig fehlgeschlagene oder grenzwertige Antworten und routet erst nach der Schemaprüfung. Die Rohantwort wird zur Diagnose aufbewahrt, aber fehlerhafte Ausgaben erreichen den Renderer nicht.
Der unangenehme Fehler ist eine meist gute Antwort mit einem fehlerhaften Quelleneintrag. Für einen Menschen sieht sie fertig aus. Die Benutzeroberfläche erwartet einen Titel und eine URL und bricht dann an der Grenze zusammen. Man verwirft sie früh. Wiederholt wird nur, wenn die Fehlerpolitik besagt, dass ein Wiederholungsversuch sicher ist; ein Schemafehler ist nicht automatisch ein vorübergehender Netzwerkfehler.
Meine Entscheidungsregel ist kurz: Man wählt Claude 3.5 Sonnet, wenn der Test bestätigt, dass seine konversationelle Qualität 2 bis 3 Sekunden wert ist. Man wählt den schnellen Budget-Kandidaten, wenn seine Antwortzeit von 1 bis 2 Sekunden und seine gute Qualität den Objektvertrag erfüllen. Man behält Gemini 1.5 Pro im Rennen, wenn seine Antworten oder die Plattformpassung die etwas langsamere Antwort rechtfertigen. Und man führt den Test mit echten Prompts aus der privaten Wissensbasis erneut durch, bevor man sich festlegt.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Short answer: For a media chatbot over a private knowledge base, start with Claude 3.5 Sonnet for conversational quality, then use the faster budget candidate when its structured-output pass rate is acceptable; keep Gemini 1.5 Pro in the test set.
Choose the model that passes your response contract most consistently. Treat conversational quality and latency as constraints around that result.
The deciding artifact is not a leaderboard. It is a valid object containing an answer, supporting sources, and an honest missing-answer state. A fluent paragraph that cannot be parsed is a failed request.
Write the contract before choosing the provider. For a media archive, I would start with answer, sources, and confidence, then define what an empty source list means when the private collection does not contain the answer. The validator should reject malformed source entries before they reach the UI.
This changes the evaluation. Score structured-output validity and grounded answer quality separately. Record perceived response time and usage cost, but do not let a quick response hide a repair pass. I would test ordinary questions, ambiguous headlines, requests for multiple sources, and questions whose answer is absent. Four cases are enough to expose a surprisingly large amount of integration glue.
Use the same prompt set for every candidate. Streaming is useful here: all three model options support it, and partial text improves perceived performance while the application waits for the complete object. It does not make an invalid final object valid.
Claude 3.5 Sonnet is the quality-led choice in the supplied comparison. It produces the most natural conversational responses, with a stated 2–3 second latency range. That is a reasonable fit for an archive assistant where follow-up questions and source-aware prose matter more than the last second.
The fast budget candidate has good quality and a 1–2 second response range. It is the practical choice for a high-volume chatbot when the contract test shows that its output objects do not create extra repair work. The speed is useful only if the validator accepts what arrives.
Gemini 1.5 Pro also has good quality and competitive pricing, but is slightly slower than the fast candidate. It is a credible choice when the evaluation set favors its answers or when the surrounding application already fits that provider's platform. “Competitive” is not a reason to skip the test.
The ranges above are starting assumptions, not a promise for your workload. Retrieval size, prompt shape, streaming behavior, and the private corpus all change the observed result.
Here is the failure I would design around. The answer says which episode introduced a host, and the prose is correct, but one source object contains a title with no document identifier. A human reviewer may understand it. The renderer cannot reliably link it, and a downstream citation check cannot distinguish a real source from a plausible-looking label. Reject the complete object, record the validation reason, and show a controlled retry or an explicit unavailable answer. This adds a little work to the request path, but it keeps a convincing paragraph from becoming a broken citation in production.
Keep the model call behind an adapter. The harness below deliberately contains no copied benchmark numbers. It makes the scoring policy explicit and forces the team to fill in measurements from its own prompts.
import OpenAI from " openai "; type Candidate = { name: string; structuredOutputRate: number; groundedAnswerRate: number; latencySeconds: number; }; const candidates: Candidate [] = [ { name: " Claude 3.5 Sonnet ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, { name: " Fast budget candidate ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, { name: " Gemini 1.5 Pro ", structuredOutputRate: 0, groundedAnswerRate: 0, latencySeconds: 0 }, ]; async function askWithInfrai ( question: string, context: string ) { const client = new OpenAI ({ apiKey: process. env. INFRAI_API_KEY, baseURL: process. env. INFRAI_BASE_URL, }); for ( let attempt = 0; attempt < 4; attempt += 1 ) { try { return await client. chat. completions. create ({ model: " deepseek-v4-flash-0731 ", messages: [ { role: " system ", content: " Return JSON with answer, sources, and confidence.
Use only the supplied context. ", }, { role: " user ", content: `Context:\n ${ context } \n\nQuestion:\n ${ question } ` }, ], }); } catch ( error ) { const status = ( error as { status?: number }). status; if ( status!== 429 || attempt === 3 ) throw error; const retryAfter = Number ( ( error as { headers?: { get?: ( name: string ) => string | null } }). headers?. get?.( " retry-after " )?? 0, ); await new Promise (( resolve ) => setTimeout ( resolve, retryAfter > 0? retryAfter * 1000: 2 ** attempt * 250 ), ); } } throw new Error ( " request retry limit reached " ); } function score ( candidate: Candidate ): number { const contract = candidate. structuredOutputRate * 0.6; const grounding = candidate. groundedAnswerRate * 0.3; const latencyBonus = Math. max ( 0, 1 - candidate. latencySeconds / 5 ) * 0.1; return contract + grounding + latencyBonus; } console. table ( candidates. map (( candidate ) => ({... candidate, score: score ( candidate ) })). sort (( left, right ) => right. score - left. score ), ); Enter fullscreen mode Exit fullscreen mode The zeroes are intentional.
They prevent a team from turning a published comparison into fake production evidence. Populate them from repeated runs against the same question set, and keep the prompt and schema versions beside each result. The call above uses the OpenAI-compatible surface with an environment variable for authentication, explicit model selection, response errors, and exponential backoff for HTTP 429.
Parse and validate its returned content before rendering it.
The 0.6 weight is a policy choice, not a scientific constant. If a malformed source object can block publication, raise that weight. If a conversational archive assistant is allowed to answer without citations, change the contract instead of pretending every product has the same job.
A unified API helps with the work around the model decision. Infrai's public discovery surface is self-describing: a capability exposes its request and response schema, billing details, and runnable examples, so wiring a new capability can begin by reading one endpoint instead of learning another SDK. The same platform spans 295 routes across 20 modules under one key, which can reduce the credential and billing reconciliation work when a chatbot later needs storage, scheduling, or observability.
That is a real integration advantage. It is not evidence that one model will produce better citations than another. The answer contract still needs provider-specific fixtures, and the validator still needs to run at the application boundary. A simple interface can reduce glue code; it cannot remove the need to measure structured correctness.
Infrai also removes a different kind of friction: one credential and one billing relationship can cover capabilities beyond this chatbot, rather than making the team collect keys and reconcile invoices as storage, scheduling, or observability enter the workflow. The breadth is concrete: 295 routes across 20 modules. That is useful operationally, but it remains separate from answer quality.
There are also capability boundaries to account for. Audio transcription is listed but unavailable, real-time voice session access is pending and limited by region, and there is no dedicated moderation endpoint. For this article's text chatbot, those facts are not blockers. They matter if the archive roadmap includes voice ingestion or a separate moderation workflow.
At small volume, one adapter, one schema validator, and a versioned prompt set are enough. At scale, log validation outcomes and request identifiers, sample failed or borderline answers, and route only after the schema check. Preserve the raw response for diagnosis, but do not let malformed output reach the renderer.
The awkward failure is a mostly good answer with one bad source entry. It looks finished to a person. The UI expects a title and URL, then breaks at the boundary. Reject it early. Retry only when the failure policy says a retry is safe; a schema failure is not automatically a transient network failure.
My decision rule is short: choose Claude 3.5 Sonnet when the test confirms that its conversational quality is worth 2–3 seconds. Choose the fast budget candidate when its 1–2 second response and good quality pass the object contract. Keep Gemini 1.5 Pro in contention when its answers or platform fit justify the slightly slower response. Re-run the test with real private-knowledge prompts before committing.