AI Context Packager — Format Docs for Claude, GPT, Fine-Tuning JSONL
Package multi-document content into Anthropic XML <documents> blocks, OpenAI fine-tuning JSONL datasets, or token-efficient YAML. Optimise context for LLM ingestion in one click. 100% client-side.
Frequently Asked Questions
What is the Anthropic XML format used for?
Anthropic recommends wrapping retrieved documents in <documents><document><source>…</source><document_content>…</document_content></document></documents> blocks when passing multi-document context to Claude. This structure helps the model clearly attribute information to specific sources and reduces hallucination in retrieval-augmented generation (RAG) pipelines.
How does the OpenAI JSONL format work for fine-tuning?
OpenAI fine-tuning expects one JSON object per line, each containing a "messages" array with system, user, and assistant turns. Each document you add becomes a training example where the title becomes the user message and the content becomes the assistant response. Upload the resulting .jsonl file directly to the OpenAI fine-tuning API endpoint.
Why use YAML instead of JSON for LLM prompts?
YAML omits quotes around most strings and uses indentation instead of brackets and braces, making it about 15–20% more token-efficient than equivalent JSON for the same structured content. This matters when operating close to a model's context window limit. The tradeoff is that YAML is slightly harder to generate programmatically, which is why this tool automates the conversion.