Hub

Chat completions hub

Everything you need to build production chat experiences with the Meridian API. From basic message formatting to advanced tool‑calling pipelines — pick a topic and dive in.

Tool callingDefine functions the model can invoke — fetch live data, run SQL, call APIs, or trigger actions mid-conversation.StreamingServer-Sent Events transport that delivers tokens as they are generated, cutting time-to-first-byte and enabling real-time UIs.Max tokensHard cap on total output tokens per request. Prevents runaway generations and keeps latency predictable.Temperature & Top‑pControl randomness: temperature scales logits, top‑p nucleus sampling truncates the tail. Dial creativity vs determinism.System promptSet the assistant's persona, tone, and constraints. The system message is the highest‑priority steering signal.Few‑shot examplesSupply input/output pairs in the messages array to teach the model a pattern without fine‑tuning.Chain‑of‑thoughtPrompt the model to reason step‑by‑step before answering. Improves accuracy on math, logic, and multi‑hop tasks.Response formatForce JSON mode or structured outputs so the model returns parseable data — critical for downstream automation.LogprobsReturn per‑token log probabilities. Use for confidence scoring, classification thresholds, or debugging token choices.Seed & determinismPin the random seed for reproducible outputs. Combine with temperature 0 for fully deterministic runs.Multiple completionsRequest n alternative completions in one call. Compare, rank, or ensemble responses without extra round‑trips.Chat history managementStrategies for trimming, summarizing, and paginating conversation context so you stay inside the model's context window.Message rolessystem, user, assistant, tool — how each role shapes the conversation and when to use them.

New to the chat API? Start with Message roles and System prompt to understand the fundamentals, then explore streaming and tool calling for production workloads.