Streaming is one keyword
client.chat_completion(..., stream=True) returns a generator yielding ChatCompletionStreamOutput objects. Each chunk has .choices[0].delta.content. The shape mirrors the OpenAI streaming format, so the same UI code that handles OpenAI streams handles HF.
Tool calling
Pass tools=[{...}] as JSON-schema-shaped dicts. The model responds with tool_calls in the assistant message. You execute them locally and append the results as {"role": "tool", ...} messages, then loop. The contract is OpenAI-compatible: same dict shapes.
Structured output
For JSON-mode, three approaches: (1) prompt the model and validate, (2) response_format={"type": "json_object"} if the provider supports it, (3) a Pydantic-driven library like outlines or instructor. Approach 3 is the most reliable across providers.