together-batch-inference
Together Batch Inference
Overview
Use Together AI's Batch API for large offline workloads where latency is not the primary concern.
Typical fits:
- bulk classification
- synthetic data generation
- dataset transformations
- large summarization or enrichment jobs
- low-cost asynchronous inference
When This Skill Wins
- The user has many independent requests to run
- A JSONL request file is acceptable
- Turnaround time can be minutes or hours instead of seconds
- Lower cost matters more than immediate interactivity
Hand Off To Another Skill
- Use
together-chat-completionsfor real-time requests or tool-calling apps - Use
together-evaluationsfor managed LLM-as-a-judge workflows - Use
together-embeddingsfor retrieval-specific vector generation
Quick Routing
- End-to-end batch workflow
- Start with scripts/batch_workflow.py or scripts/batch_workflow.ts
- Request format, status model, and result downloads
- Operational guidance and batch sizing
Workflow
- Build a JSONL file where each line contains
custom_idandbody. - Upload the file with
purpose="batch-api". - Create the batch with
input_file_id=...and the target endpoint. - Poll until the job is terminal.
- Download output and error files, then reconcile by
custom_id.
High-Signal Rules
- Python scripts require the Together v2 SDK (
together>=2.0.0). If the user is on an older version, they must upgrade first:uv pip install --upgrade "together>=2.0.0". - Use
input_file_id, not legacy file parameters. - Keep
custom_idstable and meaningful so result reconciliation is easy. - Batch is for independent requests. If the workload depends on shared conversation state, it is probably the wrong tool.
- Always inspect the error file in addition to the success output.
client.batches.create()returns a wrapper; access the batch object viaresponse.job(e.g.,response.job.id).client.batches.retrieve()returns the batch object directly.- For classification or labeling workloads, set
max_tokenslow (e.g., 4), usetemperature: 0, and constrain the system prompt to return only the label. This minimizes output tokens and cost. - Small batches (under 1K requests) typically complete in minutes. The 24-hour completion window is a maximum, not typical.
Resource Map
- API reference and operational guidance: references/api-reference.md
- Python workflow: scripts/batch_workflow.py
- TypeScript workflow: scripts/batch_workflow.ts
Official Docs
More from zainhas/skills
together-audio
Use this skill for Together AI audio workflows: text-to-speech over REST, streaming, or realtime WebSocket APIs, plus speech-to-text transcription, translation, diarization, timestamps, and live transcription. Reach for it whenever the user needs audio in or audio out on Together AI rather than generic chat generation, image or video creation, or model training.
1together-images
Use this skill for Together AI image workflows: text-to-image generation, image editing with Kontext, FLUX model selection, LoRA-based styling, reference-image guidance, and local image downloads. Reach for it whenever the user wants to generate or edit images on Together AI rather than create videos or build text-only chat applications.
1together-video
Use this skill for Together AI video workflows: text-to-video generation, image-to-video with keyframe control, model and dimension selection, polling asynchronous jobs, and downloading completed videos. Reach for it whenever the user wants motion generation on Together AI rather than still-image generation or text-only inference.
1together-embeddings
Use this skill for Together AI embedding, retrieval, and reranking workflows: generating dense vectors, building semantic search or RAG pipelines, and using rerank models behind dedicated endpoints. Reach for it whenever the user needs vector representations or retrieval quality improvements rather than direct text generation.
1together-gpu-clusters
Use this skill for Together AI GPU clusters and raw infrastructure workflows: provisioning on-demand or reserved clusters, choosing Kubernetes vs Slurm, attaching shared storage, scaling, getting credentials, and operating cluster-backed ML or HPC jobs. Reach for it when the user needs multi-node compute or infrastructure control rather than a managed model endpoint.
1together-fine-tuning
Use this skill for Together AI fine-tuning workflows: LoRA or full fine-tuning, DPO preference tuning, VLM training, function-calling tuning, reasoning tuning, and BYOM uploads. Reach for it whenever the user wants to adapt a model on custom data rather than only run inference, evaluate outputs, or host an existing model.
1