Together AITutorial
Kimi K3: the complete developer guide
Summary
Kimi K3 is presented as Moonshot AI’s 2.8-trillion-parameter open-weights model for long-horizon coding, end-to-end knowledge work, and deep reasoning, served through Together AI’s OpenAI-compatible API. Its architecture combines Kimi Delta Attention (KDA), Attention Residuals, and Stable LatentMoE, which activates 16 of 896 experts per token—roughly 2%—and supports a 1M-token context. The implementation guide shows Python calls for configurable reasoning effort, reasoning-free instant mode, streaming, multi-image vision, strict JSON-schema output, and function tools, while noting automatic prefix caching. It also covers production-oriented details such as generous max_tokens for reasoning-heavy structured output, a 100 MB request-body limit for vision, tool-call history handling, and deployment from US infrastructure.
Context
A developer guide to running Moonshot AI’s Kimi K3 on Together AI, covering its architecture, API usage, reasoning controls, multimodal inputs, structured outputs, tools, context length, and operational details.
Approach / What changed
Install the Together Python SDK, instantiate the client with TOGETHER_API_KEY, and call model moonshotai/Kimi-K3 through the OpenAI-compatible chat completions API. The guide demonstrates configurable reasoning effort, disabled-reasoning mode, streaming deltas, URL or base64 images, JSON Schema responses, and the standard function-tool loop with assistant and tool messages.
Takeaways
K3 activates 16 of 896 Stable LatentMoE experts per token, roughly 2% of the expert pool, while Kimi Delta Attention and Attention Residuals support scaling to a 1M-token context.
Together’s API exposes low, high, and max reasoning_effort levels, with max as the default; reasoning can also be disabled through reasoning={“enabled”: False}.
For structured output, the full thinking trace is generated before the first schema-constrained token, so an overly small max_tokens value can truncate the JSON rather than the reasoning.
FAQ
Why can a small max_tokens value break structured JSON output?
K3 spends the entire thinking trace before emitting the first schema-constrained token. If max_tokens is too tight, the final JSON can be truncated even though the reasoning has already consumed the budget.
What limits apply when sending images to Kimi K3?
There is no limit on the number of images, but the whole request body must remain under 100 MB. The recommended maximum image resolution is 4096x2160, because higher resolutions increase processing time and token use without improving understanding.
How should tool calls be handled across multiple turns?
When K3 returns tool_calls, append the complete assistant message to the history, then add one tool message with the matching tool_call_id for each call before calling the model again. Use tool_choice="required" to force a call on the first turn, then switch back to "auto"; changing tool_choice does not invalidate the prefix cache.
Source and freshness
- Source
- together.ai
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.