zainhas/skills_draft · Archived

together-chat-completions

Real-time and streaming text generation via Together AI's OpenAI-compatible chat/completions API, including multi-turn conversations, tool and function calling, structured JSON outputs, and reasoning models.

First seen Feb 27, 2026

Installation

$ npx skills add zainhas/skills_draft --skill together-chat-completions

Summary

  • Real-time and streaming text generation via Together AI's OpenAI-compatible chat/completions API, including multi-turn conversations, tool and function calling, structured JSON outputs, and reasoning models.
  • Reach for it whenever the user wants to build or debug text generation on Together AI, unless they specifically need batch jobs, embeddings, fine-tuning, dedicated endpoints, dedicated containers, or GPU clusters.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from zainhas/skills_draft · top by installs.

npx skills add zainhas/skills_draft

Browse all from zainhas/skills_draft

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 2
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 7,275 B
  • docs SUMMARY.md 454 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 13 installs

SKILL.md

Together Chat Completions

Overview

Use Together AI's serverless chat/completions API for interactive inference workloads:

  • basic text generation
  • streaming responses
  • multi-turn chat state
  • tool and function calling
  • structured outputs
  • reasoning-capable models

Treat this skill as the default entry point for Together AI text generation unless the task is clearly offline batch processing, vector retrieval, model training, or infrastructure management.

When This Skill Wins

  • Build a chatbot, assistant, or text-generation endpoint on Together AI
  • Add streaming output to a real-time user experience
  • Implement tool calling or function-calling loops
  • Constrain model output to JSON or a regex-defined shape
  • Choose between standard chat models and reasoning models
  • Debug request parameters, model behavior, or response shapes

Hand Off To Another Skill

  • Use together-batch-inference for large offline runs, backfills, or lower-cost asynchronous jobs
  • Use together-embeddings for vector search, semantic retrieval, or reranking
  • Use together-fine-tuning when the user wants to train or adapt a model
  • Use together-dedicated-endpoints when the user needs always-on single-tenant hosting
  • Use together-dedicated-containers or together-gpu-clusters for custom infrastructure

Quick Routing

  • Basic chat, streaming, or multi-turn state

- Start with [references/api-parameters.md](references/api-parameters.md) - Use [scripts/chatbasic.py](scripts/chatbasic.py) or [scripts/chatbasic.ts](scripts/chatbasic.ts)

  • OpenAI SDK migration, rate limits, or debug headers

- Read [references/api-parameters.md](references/api-parameters.md) - Use [scripts/debugheaders.py](scripts/debugheaders.py) or [scripts/debugheaders.ts](scripts/debugheaders.ts)

  • Parallel async requests

- Use [scripts/asyncparallel.py](scripts/asyncparallel.py)

  • Tool calling or function calling

- Read [references/function-calling-patterns.md](references/function-calling-patterns.md) - Start from [scripts/toolcallloop.py](scripts/toolcallloop.py) or [scripts/toolcallloop.ts](scripts/toolcallloop.ts)

  • Structured outputs

- Read [references/structured-outputs.md](references/structured-outputs.md) - Start from [scripts/structuredoutputs.py](scripts/structuredoutputs.py) or [scripts/structuredoutputs.ts](scripts/structuredoutputs.ts)

  • Reasoning models or thinking-mode toggles

- Read [references/reasoning-models.md](references/reasoning-models.md) - Start from [scripts/reasoningmodels.py](scripts/reasoningmodels.py) or [scripts/reasoningmodels.ts](scripts/reasoningmodels.ts)

  • Combining tools + structured output, or tools + streaming

- Read the "Combining Tool Calls with Structured Output" section in [references/function-calling-patterns.md](references/function-calling-patterns.md) - Read the "Streaming Structured Output" section in [references/structured-outputs.md](references/structured-outputs.md)

  • Model selection, context length, or pricing-aware choices

- Read [references/models.md](references/models.md)

Workflow

  1. Confirm that the workload is interactive serverless inference rather than batch, retrieval, or training.
  2. Pick the smallest model that satisfies latency, quality, and context requirements.
  3. Decide whether the job needs plain text, tools, structured output, or reasoning.
  4. Start from the matching script instead of re-deriving request shapes from scratch.
  5. Pull deeper details from the relevant reference file only when needed.

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 client.chat.completions.create() for Python and client.chat.completions.create() for TypeScript.
  • Preserve full messages history for multi-turn conversations; do not rebuild context from final text only.
  • For tools, implement the full loop: model tool call -> execute tool -> append tool result -> second model call.
  • Prefer json_schema over looser JSON modes when the user needs stable machine-readable output.
  • Use reasoning models only when the task benefits from deeper deliberation; otherwise prefer cheaper standard models.
  • To combine tool calling with structured output, use a two-phase approach: Phase 1 sends tools (no responseformat), Phase 2 sends responseformat (no tools) after tool results are appended.
  • Streaming works with response_format; accumulate chunks and parse the final concatenated string as JSON.
  • If the user needs many independent requests, combine this skill with async_parallel.py or hand off to batch inference.

Resource Map

  • Parameters and response fields: [references/api-parameters.md](references/api-parameters.md)
  • OpenAI compatibility, rate-limit headers, and debug headers: [references/api-parameters.md](references/api-parameters.md)
  • Function-calling patterns: [references/function-calling-patterns.md](references/function-calling-patterns.md)
  • Structured outputs: [references/structured-outputs.md](references/structured-outputs.md)
  • Reasoning models: [references/reasoning-models.md](references/reasoning-models.md)
  • Model catalog: [references/models.md](references/models.md)

Scripts

  • [scripts/chatbasic.py](scripts/chatbasic.py) and [scripts/chatbasic.ts](scripts/chatbasic.ts): basic chat, streaming, and multi-turn state
  • [scripts/debugheaders.py](scripts/debugheaders.py) and [scripts/debugheaders.ts](scripts/debugheaders.ts): raw-response inspection for routing, latency, and rate-limit headers
  • [scripts/asyncparallel.py](scripts/asyncparallel.py): async Python fan-out for independent requests
  • [scripts/toolcallloop.py](scripts/toolcallloop.py) and [scripts/toolcallloop.ts](scripts/toolcallloop.ts): full tool-call loop
  • [scripts/structuredoutputs.py](scripts/structuredoutputs.py) and [scripts/structuredoutputs.ts](scripts/structuredoutputs.ts): schema-guided and regex outputs
  • [scripts/reasoningmodels.py](scripts/reasoningmodels.py) and [scripts/reasoningmodels.ts](scripts/reasoningmodels.ts): reasoning fields, effort, and hybrid toggles

Official Docs