### Python v2 SDK - Get Batch Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for retrieving batch information. ```python client.batches.retrieve() ``` -------------------------------- ### Install Together AI Skills Source: https://context7.com/togethercomputer/skills/llms.txt Instructions for installing Together AI Skills using various CLI tools and manual copy methods. Includes verification and setup steps. ```bash # Universal install (Claude Code, Cursor, Codex, and others) npx skills add togethercomputer/skills # Manual install for Claude Code cp -r skills/together-* ~/.claude/skills/ # Manual install for Cursor cp -r skills/together-* your-project/.cursor/skills/ # Manual install for Codex cp -r skills/together-* your-project/.agents/skills/ # Gemini CLI gemini extensions install https://github.com/togethercomputer/skills.git --consent # Verify (Claude Code) ls ~/.claude/skills/together-*/SKILL.md # Setup export TOGETHER_API_KEY=your_key uv pip install "together>=2.0.0" ``` -------------------------------- ### Install Together CLI and Log In Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/tcloud-cli.md Install the Together Python SDK and log in to your account using pip. ```shell uv pip install "together>=2.0.0" together auth login ``` -------------------------------- ### Python v2 SDK - Get Endpoint Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for retrieving endpoint details. ```python client.endpoints.retrieve() ``` -------------------------------- ### Python v2 SDK - Get File Content Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for retrieving the content of a file. ```python client.files.content() ``` -------------------------------- ### Full Jig Configuration Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md A comprehensive example demonstrating the integration of project dependencies, image build settings, deployment configurations, environment variables, and volume mounts. ```toml [project] name = "video-generator" version = "0.1.0" requires-python = ">=3.11" dependencies = ["diffusers", "sprocket"] [tool.jig.image] python_version = "3.11" system_packages = ["git", "ffmpeg", "libgl1"] environment = { TORCH_CUDA_ARCH_LIST = "8.0 9.0" } run = [ "pip install torch --index-url https://download.pytorch.org/whl/cu121", "pip install flash-attn --no-build-isolation", ] cmd = "python app.py --queue" copy = ["app.py", "models/"] [tool.jig.deploy] description = "Video generation model" gpu_type = "h100-80gb" gpu_count = 2 cpu = 8 memory = 64 min_replicas = 1 max_replicas = 20 port = 8000 health_check_path = "/health" [tool.jig.deploy.environment_variables] MODEL_PATH = "/models/weights" TORCH_COMPILE = "1" [[tool.jig.volume_mounts]] name = "my-weights" mount_path = "/models" ``` -------------------------------- ### Install Together CLI Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Install the Together CLI using uv pip or uv tool. ```shell uv pip install "together>=2.0.0" # or uv tool install together ``` -------------------------------- ### Install Together v2 SDK Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/SKILL.md Ensure you have the Together v2 SDK installed for Python scripts. Upgrade if necessary. ```bash uv pip install --upgrade "together>=2.0.0" ``` -------------------------------- ### Install Together Python SDK and Set API Key Source: https://github.com/togethercomputer/skills/blob/main/README.md Install the Together Python SDK and set your API key. This is required before running any of the provided scripts. ```bash uv pip install "together>=2.0.0" export TOGETHER_API_KEY=your_key ``` -------------------------------- ### Python v2 SDK - Create Batch Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for creating a batch job. ```python client.batches.create() ``` -------------------------------- ### Slurm Partition Configuration Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/cluster-management.md Example configurations for Slurm partitions, defining node groups and their states. Partitions allow for logical separation of compute resources. ```text PartitionName=gpu Nodes=gpu-nodes State=UP Default=NO MaxTime=24:00:00 PartitionName=cpu Nodes=cpu-nodes State=UP Default=YES ``` -------------------------------- ### Slurm GPU Resource Configuration Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/cluster-management.md Example configuration for defining generic GPU resources in Slurm. This maps resource names to physical devices. ```text Name=gpu Type=h100 File=/dev/nvidia[0-7] ``` -------------------------------- ### Slurm Cgroup Settings Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/cluster-management.md Example configuration for Slurm's cgroup settings. These control how resources are managed and constrained for jobs. ```text CgroupPlugin=cgroup/v1 ConstrainCores=yes ConstrainRAMSpace=yes ``` -------------------------------- ### Python v2 SDK - Create Evaluation Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for creating an evaluation. ```python client.evals.create() ``` -------------------------------- ### Python v2 SDK - Run Code Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Demonstrates the correct v2 SDK method for executing code via the code interpreter. ```python client.code_interpreter.execute() ``` -------------------------------- ### Create Video Response Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-video/references/api-reference.md This is an example of the JSON response received after submitting a video creation job. It includes the job ID and its initial status. ```json { "id": "019a0068-794a-7213-90f6-cc4eb62e3da7", "object": "video", "model": "minimax/video-01-director", "status": "in_progress", "created_at": 1729407438 } ``` -------------------------------- ### Slurm Scheduler Tuning Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/cluster-management.md Example parameters for tuning the Slurm scheduler. These settings affect job scheduling behavior and performance. ```text SchedulerParameters=batch_sched_delay=10,bf_interval=180,sched_max_job_start=500 ``` -------------------------------- ### Install Together AI Skills for Gemini CLI Source: https://github.com/togethercomputer/skills/blob/main/README.md Installs the Together AI skills as an extension for the Gemini CLI. This command fetches the skills from the provided GitHub repository. ```bash gemini extensions install https://github.com/togethercomputer/skills.git --consent ``` -------------------------------- ### Install CUDA-enabled PyTorch Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Use the `run` command in `[tool.jig.image]` to install the CUDA-enabled PyTorch wheel. Do not list `torch` in `[project] dependencies` when using this method. ```toml [tool.jig.image] run = ["pip install torch --index-url https://download.pytorch.org/whl/cu121"] ``` -------------------------------- ### Fine-tuning Example Prompt Source: https://github.com/togethercomputer/skills/blob/main/README.md Use this prompt to ask the agent to fine-tune Llama 3.1 8B on a dataset using Together AI with LoRA. ```bash > Fine-tune Llama 3.1 8B on my dataset using Together AI with LoRA ``` -------------------------------- ### Install All Together AI Skills Source: https://github.com/togethercomputer/skills/blob/main/README.md Installs all Together AI skills at once using the skills.sh script. This method is compatible with various AI coding agents that support the Agent Skills specification. ```bash npx skills add togethercomputer/skills ``` -------------------------------- ### SKILL.md Frontmatter Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Shows the required YAML frontmatter for a SKILL.md file, including name and description fields. ```yaml --- name: together- description: "One-line description, no angle brackets, max 1024 chars" --- ``` -------------------------------- ### OpenAI/Codex UI Metadata Example Source: https://context7.com/togethercomputer/skills/llms.txt Example of agent metadata configuration in agents/openai.yaml, specifying display name, short description, and a default prompt for the Together Chat Completions skill. ```yaml # agents/openai.yaml — UI metadata for OpenAI/Codex surfaces display_name: "Together Chat Completions" short_description: "Real-time text generation via Together AI" default_prompt: "Use $together-chat-completions to build a chatbot with Llama 3.3 70B" ``` -------------------------------- ### Install Sprocket SDK Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/sprocket-sdk.md Install the Sprocket SDK using pip. Include the extra index URL for Together's private PyPI. Alternatively, configure your pyproject.toml for private package management. ```shell pip install sprocket --extra-index-url https://pypi.together.ai/ # or with Together's private PyPI in pyproject.toml: [[tool.uv.index]] name = "together-pypi" url = "https://pypi.together.ai/" ``` -------------------------------- ### Verify Together AI Skills Installation for Codex Source: https://github.com/togethercomputer/skills/blob/main/README.md Verifies the installation of Together AI skills for Codex by listing the SKILL.md files in the specified directory. This confirms that the skills have been correctly copied. ```bash ls your-project/.agents/skills/together-*/SKILL.md ``` -------------------------------- ### Image Generation Example Prompt Source: https://github.com/togethercomputer/skills/blob/main/README.md Use this prompt to ask the agent to generate a FLUX image with Together AI and save it locally as PNG. ```bash > Generate a FLUX image with Together AI and save it locally as PNG ``` -------------------------------- ### Verify Together AI Skills Installation for Claude Code Source: https://github.com/togethercomputer/skills/blob/main/README.md Verifies the installation of Together AI skills for Claude Code by listing the SKILL.md files in the specified directory. This confirms that the skills have been correctly copied. ```bash ls your-project/.claude/skills/together-*/SKILL.md ``` -------------------------------- ### Reasoning Format Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-fine-tuning/references/data-formats.md JSON structure for fine-tuning reasoning models. Assistant messages include 'reasoning' for chain-of-thought and 'content' for the final answer. ```json { "messages": [ {"role": "user", "content": "What is 15% of 240?"}, { "role": "assistant", "reasoning": "15% means 15/100 = 0.15\n0.15 * 240 = 36", "content": "15% of 240 is 36." } ] } ``` -------------------------------- ### Preference Reasoning Format Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-fine-tuning/references/data-formats.md JSON structure for preference fine-tuning with reasoning. Includes 'reasoning' in both preferred and non-preferred assistant outputs. ```json { "input": { "messages": [{"role": "user", "content": "What is 15% of 240?"}] }, "preferred_output": [ { "role": "assistant", "reasoning": "15% means 15/100 = 0.15\n0.15 * 240 = 36", "content": "15% of 240 is 36." } ], "non_preferred_output": [ { "role": "assistant", "reasoning": "15% of 240... about 30 maybe?", "content": "About 30." } ] } ``` -------------------------------- ### Example Output for List Regions Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/tcloud-cli.md This JSON output shows the available regions, their supported GPU instance types, and CUDA driver versions. ```json { "regions": [ { "driver_versions": [ "CUDA_12_6_565", "CUDA_12_5_555", "CUDA_12_8_570", "CUDA_12_9_575", "CUDA_12_6_560", "CUDA_12_4_550" ], "name": "us-central-8", "supported_instance_types": [ "H100_SXM", "H200_SXM" ] } ] } ``` -------------------------------- ### Verbose JSON Response - Word Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-audio/references/stt-models.md An example of a word within a verbose JSON response, including the word itself and its start and end times. ```json {"word": "Hello", "start": 0.00, "end": 0.36} ``` -------------------------------- ### Verbose JSON Response - Segment Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-audio/references/stt-models.md An example of a segment within a verbose JSON response, including start and end times and the transcribed text. ```json {"start": 0.11, "end": 10.85, "text": "..."} ``` -------------------------------- ### Create Video Job with Advanced Parameters (Python) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-video/references/api-reference.md Example demonstrating advanced parameters for video creation, including duration, FPS, steps, guidance scale, and negative prompts. ```python job = client.videos.create( prompt="A futuristic city at night with neon lights reflecting on wet streets", model="minimax/hailuo-02", width=1366, height=768, seconds="6", fps=30, steps=30, guidance_scale=8.0, output_format="MP4", output_quality=20, seed=42, negative_prompt="blurry, low quality, distorted", ) ``` -------------------------------- ### Initialize Jig Project Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Create a starter pyproject.toml file for a new Jig project. ```shell together beta jig init ``` -------------------------------- ### TypeScript: Simple JSON Object Output Source: https://github.com/togethercomputer/skills/blob/main/skills/together-chat-completions/references/structured-outputs.md Generate a JSON object with keys guided by the prompt using the Together AI TypeScript SDK. Ensure you have the 'together-ai' package installed. ```typescript import Together from "together-ai"; const together = new Together(); const response = await together.chat.completions.create({ model: "openai/gpt-oss-20b", messages: [ { role: "system", content: "Respond in JSON with keys: name, age, city" }, { role: "user", content: "Tell me about yourself" }, ], response_format: { type: "json_object" }, }); console.log(response.choices[0].message.content); ``` -------------------------------- ### Parallel Calls to Same Function Source: https://github.com/togethercomputer/skills/blob/main/skills/together-chat-completions/references/function-calling-patterns.md Demonstrates how a model can be prompted to call the same function multiple times within a single turn, for example, to get weather data for several locations. This is useful for batch operations. ```python response = client.chat.completions.create( model="Qwen/Qwen2.5-7B-Instruct-Turbo", messages=[ {"role": "system", "content": "You are a helpful assistant that can access external functions."}, { "role": "user", "content": "What is the current temperature of New York, San Francisco and Chicago?", }, ], tools=[{ "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, }, }, }], ) # Model returns 3 tool_calls: # get_current_weather(location="New York, NY", unit="fahrenheit") # get_current_weather(location="San Francisco, CA", unit="fahrenheit") # get_current_weather(location="Chicago, IL", unit="fahrenheit") for tc in response.choices[0].message.tool_calls: print(f" {tc.function.name}({tc.function.arguments})") ``` ```typescript const response = await together.chat.completions.create({ model: "Qwen/Qwen2.5-7B-Instruct-Turbo", messages: [ { role: "system", content: "You are a helpful assistant that can access external functions.", }, { role: "user", content: "What is the current temperature of New York, San Francisco and Chicago?", }, ], tools: [ { type: "function", function: { name: "getCurrentWeather", description: "Get the current weather in a given location", parameters: { type: "object", properties: { location: { type: "string", description: "The city and state, e.g. San Francisco, CA", }, unit: { type: "string", description: "The unit of temperature", enum: ["celsius", "fahrenheit"], }, }, }, }, }, ], }); // Model returns 3 tool_calls for NYC, SF, and Chicago console.log(JSON.stringify(response.choices[0].message?.tool_calls, null, 2)); ``` -------------------------------- ### Control Reasoning Depth via Prompting (Python) - Budget Source: https://github.com/togethercomputer/skills/blob/main/skills/together-chat-completions/references/reasoning-models.md You can also suggest a reasoning budget, like a word count, within the prompt to guide the model's thinking process. This example suggests using around 1000 words for thinking. ```python # Or suggest a reasoning budget response = client.chat.completions.create( model="deepseek-ai/DeepSeek-V4-Pro", messages=[ { "role": "user", "content": ( "Please use around 1000 words to think, " "but do not literally count each one.\n\n" "Explain why quicksort has O(n log n) average-case complexity." ), } ], stream=True, ) ``` -------------------------------- ### Execute Python Code in a Stateful Sandbox Source: https://context7.com/togethercomputer/skills/llms.txt This example demonstrates how to use the Together AI Code Interpreter to execute Python code within a managed sandbox. It shows how to start a new session, reuse an existing session to maintain state (variables and imports), and handle potential errors during execution. ```python # execute_with_session.py — stateful Python sandbox execution from together import Together client = Together() def execute(code: str, session_id: str | None = None) -> dict: response = client.code_interpreter.execute( code=code, language="python", **({"session_id": session_id} if session_id else {}), ) if response.errors: print(f"Errors: {response.errors}") return {"session_id": None, "outputs": []} for output in response.data.outputs: if output.type in ("stdout", "stderr", "error"): print(f" [{output.type}] {output.data}") return {"session_id": response.data.session_id, "outputs": response.data.outputs} # 1. Start a new session result = execute("print('Hello from Together Sandbox!')") session_id = result["session_id"] print(f"Session: {session_id}") # 2. Reuse session — state persists across calls execute("x = 42\nprint(f'Set x = {x}')", session_id) execute("print(f'x is still {x}')", session_id) # x is still 42 ``` -------------------------------- ### Start or Stop an Endpoint Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/api-reference.md Control the running state of an endpoint by setting its state to 'STARTED' or 'STOPPED'. ```python # Start client.endpoints.update("endpoint-abc123", state="STARTED") # Stop client.endpoints.update("endpoint-abc123", state="STOPPED") ``` ```typescript // Start await together.endpoints.update("endpoint-abc123", { state: "STARTED" }); // Stop await together.endpoints.update("endpoint-abc123", { state: "STOPPED" }); ``` ```shell # Start curl -X PATCH "https://api.together.xyz/v1/endpoints/endpoint-abc123" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"state": "STARTED"}' # Stop curl -X PATCH "https://api.together.xyz/v1/endpoints/endpoint-abc123" \ -H "Authorization: Bearer $TOGETHER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"state": "STOPPED"}' ``` ```shell together endpoints start together endpoints start --wait together endpoints stop together endpoints stop --wait ``` -------------------------------- ### Deploy Application Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Build, push, and deploy your application. Use flags like --tag, --warmup, --build-only, or --image to customize the deployment process. ```shell together beta jig deploy [flags] ``` -------------------------------- ### OpenAI Compatibility Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-chat-completions/references/api-parameters.md Demonstrates how to use the Together API with an OpenAI-compatible client by setting the base URL and API key. This allows for a seamless migration for users familiar with the OpenAI SDK. ```APIDOC ## OpenAI Compatibility Migrate from the OpenAI SDK by changing the base URL and API key while keeping the chat/completions shape the same: ```python from openai import OpenAI client = OpenAI( base_url="https://api.together.xyz/v1", api_key="YOUR_TOGETHER_API_KEY", ) response = client.chat.completions.create( model="openai/gpt-oss-20b", messages=[{"role": "user", "content": "Hello!"}], ) print(response.choices[0].message.content) ``` Use the native Together SDK when you need Together-only helpers such as `.with_raw_response`, typed reasoning fields, or other platform-specific workflows already covered by this skill. ``` -------------------------------- ### Upload Response Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/api-reference.md Example JSON response when a model upload job is successfully created. It includes a `job_id` for status tracking. ```json { "data": { "job_id": "job-b641db51-38e8-40f2-90a0-5353aeda6f21", "model_name": "devuser/my-custom-model", "model_source": "remote_archive" }, "message": "job created" } ``` -------------------------------- ### Streaming HTTP Event Examples Source: https://github.com/togethercomputer/skills/blob/main/skills/together-audio/references/tts-models.md Examples of server-sent events received when using streaming HTTP. Includes audio deltas and word timestamps. ```json data: {"type":"conversation.item.audio_output.delta","item_id":"tts_1","delta":""} ``` ```json data: {"type":"conversation.item.word_timestamps","words":["Hello","world"],"start_seconds":[0.0,0.4],"end_seconds":[0.4,0.8]} ``` ```text data: [DONE] ``` -------------------------------- ### Jig Init Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Initializes a new project with a starter `pyproject.toml` file, providing sensible defaults for Jig configuration. ```APIDOC ## jig init Create a starter `pyproject.toml` with sensible defaults. ```shell together beta jig init ``` ``` -------------------------------- ### Create Video Job with Advanced Parameters (TypeScript) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-video/references/api-reference.md Example demonstrating advanced parameters for video creation in TypeScript, including duration, FPS, steps, guidance scale, and negative prompts. ```typescript const job = await client.videos.create({ prompt: "A futuristic city at night with neon lights reflecting on wet streets", model: "minimax/hailuo-02", width: 1366, height: 768, seconds: "6", fps: 30, steps: 30, guidance_scale: 8.0, output_format: "MP4", output_quality: 20, seed: 42, negative_prompt: "blurry, low quality, distorted", }); ``` -------------------------------- ### Example Output from quick_validate.py Source: https://context7.com/togethercomputer/skills/llms.txt Illustrates the expected output format from the quick_validate.py script, showing successful validations (✓) and failures (✗) with specific error messages. ```bash # Expected output from quick_validate.py # ✓ together-chat-completions: name ok, description ok, files ok # ✗ together-images: references/missing-file.md not found ``` -------------------------------- ### Server Events Examples Source: https://github.com/togethercomputer/skills/blob/main/skills/together-audio/references/stt-models.md Examples of different server event types for STT, including session creation, transcription deltas, completed transcriptions, and failures. ```json {"type": "session.created", "session": {"model": "openai/whisper-large-v3"}} ``` ```json {"type": "conversation.item.input_audio_transcription.delta", "delta": "The quick brown"} ``` ```json {"type": "conversation.item.input_audio_transcription.completed", "transcript": "The quick brown fox jumps over the lazy dog"} ``` ```json {"type": "conversation.item.input_audio_transcription.failed", "error": {"message": "Error description"}} ``` -------------------------------- ### Create Video Job with Reference Images (Python) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-video/references/api-reference.md Example of creating a video job that uses reference images to influence the style of the generated video. ```python job = client.videos.create( prompt="A cat dancing energetically", model="vidu/vidu-2.0", width=1280, height=720, reference_images=[ "https://cdn.pixabay.com/photo/2020/05/20/08/27/cat-5195431_1280.jpg", ], ) ``` -------------------------------- ### Python v2 SDK - Audio File Handling Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md Illustrates the correct v2 SDK pattern for handling audio files, requiring opening the file in binary read mode. ```python with open(path, "rb") as f: pass ``` -------------------------------- ### Function Calling Example Prompt Source: https://github.com/togethercomputer/skills/blob/main/README.md Use this prompt to ask the agent to create an agent capable of checking weather and stock prices using Together AI function calling. ```bash > Create an agent that can check weather and stock prices using Together AI function calling ``` -------------------------------- ### Runtime Deployment Settings Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Configure runtime settings for deployment, including GPU type, CPU, memory, replica counts, and health check paths. ```toml [tool.jig.deploy] description = "Video generation model" gpu_type = "h100-80gb" gpu_count = 2 cpu = 8 memory = 64 min_replicas = 1 max_replicas = 20 port = 8000 health_check_path = "/health" ``` -------------------------------- ### List Hardware Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/api-reference.md List available hardware configurations for deploying endpoints. ```APIDOC ## GET /hardware ### Description Available hardware configs. ### Method GET ### Endpoint https://api.together.xyz/v1/hardware ### Response #### Success Response (200) - **data** (array) - A list of available hardware configurations. ``` -------------------------------- ### Add New Skill Script Example Source: https://github.com/togethercomputer/skills/blob/main/scripts/AGENTS_TEMPLATE.md When adding a new script for a skill, follow these conventions and include a reference in the skill's SKILL.md file. ```markdown - **Runnable script**: See [scripts/.py](scripts/.py) — short description (v2 SDK) ``` -------------------------------- ### Verbose JSON Response - Speaker Segment Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-audio/references/stt-models.md An example of a speaker segment in a verbose JSON response, detailing speaker information, time ranges, transcribed text, and associated words. ```json { "speaker_id": "SPEAKER_01", "start": 6.268, "end": 30.776, "text": "...", "words": [{"word": "Hello", "start": 6.268, "end": 11.314, "speaker_id": "SPEAKER_01"}] } ``` -------------------------------- ### Instruction Format Example Source: https://github.com/togethercomputer/skills/blob/main/skills/together-fine-tuning/references/data-formats.md JSON structure for prompt-completion pairs. By default, the model is not trained on the prompt text. Set `train_on_inputs=true` to include prompts in training. ```json {"prompt": "What is photosynthesis?", "completion": "Photosynthesis is..."} ``` -------------------------------- ### List Available Hardware for a Model (Python) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/hardware-options.md Use this Python code to list available hardware configurations for a specific model and check their status and pricing. This is useful for determining which hardware is compatible and currently available for your deployment. ```python from together import Together client = Together() response = client.endpoints.list_hardware(model="Qwen/Qwen3.5-9B-FP8") for hw in response.data: status = hw.availability.status if hw.availability else "unknown" price = hw.pricing.cents_per_minute if hw.pricing else "N/A" print(f" {hw.id} ({status}, {price}c/min)") ``` -------------------------------- ### Retrieve Deployment Logs Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Fetch logs for your deployment. Use the --follow flag to stream logs in real-time. ```shell together beta jig logs [flags] ``` -------------------------------- ### Full Endpoint Lifecycle Management Source: https://context7.com/togethercomputer/skills/llms.txt Manage the complete lifecycle of a dedicated GPU endpoint, from listing hardware to creating, starting, running inference, and stopping or deleting the endpoint. Ensure the endpoint reaches the 'STARTED' state before inference. ```python # manage_endpoint.py — full endpoint lifecycle import time from together import Together client = Together() # 1. List available hardware (check availability and pricing) response = client.endpoints.list_hardware(model="Qwen/Qwen3.5-9B-FP8") for hw in response.data: status = hw.availability.status if hw.availability else "unknown" price = hw.pricing.cents_per_minute if hw.pricing else "N/A" print(f" {hw.id} ({status}, {price}c/min)") # 2. Create endpoint with autoscaling endpoint = client.endpoints.create( model="Qwen/Qwen3.5-9B-FP8", hardware="1x_nvidia_h100_80gb_sxm", autoscaling={"min_replicas": 1, "max_replicas": 1}, display_name="My Qwen Endpoint", inactive_timeout=60, ) print(f"Created: {endpoint.id} (state: {endpoint.state})") print(f"Inference name: {endpoint.name}") # 3. Wait for STARTED state while True: ep = client.endpoints.retrieve(endpoint.id) print(f" State: {ep.state}") if ep.state == "STARTED": break if ep.state == "ERROR": raise RuntimeError(f"Endpoint error: {endpoint.id}") time.sleep(10) # 4. Run inference using endpoint.name as model response = client.chat.completions.create( model=endpoint.name, messages=[{"role": "user", "content": "What is the capital of France?"}], max_tokens=200, ) print(f"Response: {response.choices[0].message.content}") # 5. Stop (preserves config) or delete (permanent) client.endpoints.update(endpoint.id, state="STOPPED") # client.endpoints.delete(endpoint.id) ``` -------------------------------- ### Get Deployment Endpoint Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Print the endpoint URL for your deployment. ```shell together beta jig endpoint ``` -------------------------------- ### Deploy Custom or Fine-tuned Model using CLI Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/dedicated-models.md Deploy a custom or fine-tuned model via the CLI. First, verify the model is listed, then check available hardware options for the model. Finally, create the endpoint specifying the model, hardware, display name, and optionally disabling speculative decoding. ```shell # Verify model appears together models list # Check hardware options together endpoints hardware --model # Deploy together endpoints create \ --model \ --hardware 2x_nvidia_h100_80gb_sxm \ --display-name "Custom Model Endpoint" \ --no-speculative-decoding \ --wait ``` -------------------------------- ### Start/Stop Endpoint Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/api-reference.md Starts or stops an endpoint, controlling its availability for requests. ```APIDOC ## Start / Stop Endpoint ### Description Starts or stops an endpoint. ### Method PATCH ### Endpoint /v1/endpoints/{endpoint_id} ### Parameters #### Path Parameters - **endpoint_id** (string) - Required - The ID of the endpoint to start or stop. #### Request Body - **state** (string) - Required - The desired state. Use `"STARTED"` to start or `"STOPPED"` to stop. ### Request Example ```json { "state": "STARTED" } ``` ### Response #### Success Response (200) Returns the updated endpoint object. ``` -------------------------------- ### Get Evaluation Status Source: https://github.com/togethercomputer/skills/blob/main/skills/together-evaluations/references/api-reference.md Retrieves the current status of a specific evaluation. ```APIDOC ## Get Evaluation Status ### Description Retrieves the current status of a specific evaluation using its unique identifier. ### Method ```python status = client.evals.status("eval-abc123") print(status.status, status.results) ``` ### Endpoint ```shell GET https://api.together.xyz/v1/evaluation/eval-abc123/status ``` ``` -------------------------------- ### Get Cluster Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/api-reference.md Retrieve detailed information about a specific GPU cluster by its ID. ```APIDOC ## GET /compute/clusters/{id} ### Description Get cluster details. ### Method GET ### Endpoint /compute/clusters/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the cluster to retrieve ``` -------------------------------- ### List Available Hardware for a Model (CLI) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/hardware-options.md This shell command lists available hardware for a specified model, filtering for those that are currently available. It's a quick way to check hardware options directly from the command line. ```shell together endpoints hardware --model Qwen/Qwen3.5-9B-FP8 --available ``` -------------------------------- ### Driver Versions List Example (JSON) Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/api-reference.md This JSON structure represents the output of listing available driver versions per region. It includes CUDA and NVIDIA driver versions. ```json [ {"cuda_version": "12.6", "nvidia_driver_version": "560"}, {"cuda_version": "12.4", "nvidia_driver_version": "550"} ] ``` -------------------------------- ### clusters storage retrieve Source: https://github.com/togethercomputer/skills/blob/main/skills/together-gpu-clusters/references/tcloud-cli.md Get details for a specific shared storage volume. ```APIDOC ## clusters storage retrieve ### Description Get details for a specific volume. ### Method `together beta clusters storage retrieve ` ### Parameters #### Path Parameters - **VOLUME_ID** (string) - Required - The ID of the volume to retrieve details for. ``` -------------------------------- ### List Deployments Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md List all deployments within your organization. ```shell together beta jig list ``` -------------------------------- ### Get Video Status Source: https://github.com/togethercomputer/skills/blob/main/skills/together-video/references/api-reference.md Poll for job completion by providing the video job ID. ```APIDOC ## GET /v2/videos/{id} ### Description Poll for job completion. ### Method GET ### Endpoint https://api.together.xyz/v2/videos/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the video job ``` -------------------------------- ### Get Endpoint Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-endpoints/references/api-reference.md Retrieve details for a specific dedicated endpoint using its unique identifier. ```APIDOC ## GET /endpoints/{id} ### Description Get endpoint details. ### Method GET ### Endpoint https://api.together.xyz/v1/endpoints/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the endpoint. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the endpoint. - **state** (string) - The current state of the endpoint. ``` -------------------------------- ### Get Job Status Source: https://github.com/togethercomputer/skills/blob/main/skills/together-dedicated-containers/references/jig-cli.md Retrieve the status of a submitted job using its request ID. ```shell together beta jig job_status --request-id ```