together-ai
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "together-ai" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-fe790398623c05c2879741248cf3b112146cc260217af34331dacb17e2c69f41. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A cloud platform for running open-source AI models that provides inference APIs for LLMs, image models, and embedding models. Supports fine-tuning on custom data, OpenAI-compatible API format, and competitive pricing for hosting open-source models.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Tasks
- client = OpenAI( base_url="https://api.together.xyz/v1", api_key="your-together-api-key", )
- Inputs and outputs
- 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="meta-llama/Llama-3.1-70B-Instruct-Turbo", messages=[{"role": "user", "content": "List 3 programming languages with their year of creation as JSON."}], response_format={"type": "json_object"}, ) print(response.choices[0].message.content) ```
- Testing
- Not tested
Browse files
Frontmatter
name: together-ai
description: |
Cloud platform for running open-source AI models. Provides inference APIs for LLMs,
image models, and embedding models. Supports fine-tuning on custom data, OpenAI-compatible
API format, and competitive pricing for open-source model hosting.
license: Apache-2.0
compatibility: 'python 3.8+, typescript/node 18+, any OpenAI-compatible client'
metadata:
author: terminal-skills
version: 1.0.0
category: data-ai
tags:
- llm-hosting
- open-source-models
- fine-tuning
- embeddings
- inference-apiTogether AI
Installation
# Install Together Python client
pip install together
# Set API key
export TOGETHER_API_KEY="xxxxxxxxxxxx"
Chat Completions (OpenAI-Compatible)
# chat_completions.py — Use Together AI with the OpenAI SDK
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="meta-llama/Llama-3.1-70B-Instruct-Turbo",
messages=[
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function to merge two sorted lists."},
],
max_tokens=500,
temperature=0.7,
)
print(response.choices[0].message.content)
Together Python SDK
# together_sdk.py — Use the native Together SDK for additional features
import together
client = together.Together()
# Chat completion
response = client.chat.completions.create(
model="mistralai/Mixtral-8x7B-Instruct-v0.1",
messages=[{"role": "user", "content": "Explain transformers architecture."}],
max_tokens=300,
)
print(response.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="meta-llama/Llama-3.1-8B-Instruct-Turbo",
messages=[{"role": "user", "content": "Write a haiku about coding"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Embeddings
# embeddings.py — Generate embeddings for semantic search and RAG
from openai import OpenAI
client = OpenAI(
base_url="https://api.together.xyz/v1",
api_key="your-together-api-key",
)
response = client.embeddings.create(
model="togethercomputer/m2-bert-80M-8k-retrieval",
input=["What is machine learning?", "How does deep learning work?"],
)
for i, emb in enumerate(response.data):
print(f"Text {i}: {len(emb.embedding)} dimensions")
Image Generation
# image_gen.py — Generate images with open-source models
import together
import base64
client = together.Together()
response = client.images.generate(
model="stabilityai/stable-diffusion-xl-base-1.0",
prompt="A serene Japanese garden at sunset, watercolor style",
width=1024,
height=1024,
steps=30,
n=1,
)
# Save the image
image_data = base64.b64decode(response.data[0].b64_json)
with open("garden.png", "wb") as f:
f.write(image_data)
Fine-Tuning
# fine_tune.py — Fine-tune an open-source model on custom data
import together
client = together.Together()
# Upload training data (JSONL format)
file = client.files.upload(file="training_data.jsonl")
print(f"File ID: {file.id}")
# Start fine-tuning job
ft_job = client.fine_tuning.create(
training_file=file.id,
model="meta-llama/Llama-3.1-8B-Instruct-Reference",
n_epochs=3,
learning_rate=1e-5,
batch_size=4,
suffix="my-custom-model",
)
print(f"Job ID: {ft_job.id}")
# Check status
status = client.fine_tuning.retrieve(ft_job.id)
print(f"Status: {status.status}")
# training_data.jsonl — Training data format for fine-tuning
{"messages": [{"role": "system", "content": "You are a support agent."}, {"role": "user", "content": "How do I reset my password?"}, {"role": "assistant", "content": "Go to Settings > Security > Reset Password."}]}
{"messages": [{"role": "user", "content": "What are your hours?"}, {"role": "assistant", "content": "We're available 24/7 via chat and email."}]}
JSON Mode
# json_mode.py — Force structured JSON output from models
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="meta-llama/Llama-3.1-70B-Instruct-Turbo",
messages=[{"role": "user", "content": "List 3 programming languages with their year of creation as JSON."}],
response_format={"type": "json_object"},
)
print(response.choices[0].message.content)
Key Concepts
- OpenAI-compatible: Use the OpenAI SDK by changing
base_url— minimal migration effort - Open-source focus: Hosts Llama, Mistral, Mixtral, DBRX, and other open models
- Turbo models: Together-optimized versions with faster inference and lower latency
- Fine-tuning: LoRA and full fine-tuning on hosted models with simple JSONL data format
- Embeddings: Dedicated embedding models for RAG and semantic search use cases
- Pricing: Per-token pricing, typically cheaper than proprietary model APIs
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Together AI 云平台的完整使用指南,涵盖 LLM 推理、图像生成、嵌入模型、微调等核心功能
- 面向开发者群体,具有明确的技术实用价值,属于通用工具类
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 description 字段内容与 skill_body 内部 frontmatter 重复,存在冗余
Recommendation: 建议将顶层 description 字段留空,仅保留 skill_body 内部的 frontmatter description
Highlights
- 文档结构清晰,包含 Installation、各功能模块、Key Concepts 等完整章节
- 每个模块均提供完整代码示例和详细说明,frontmatter 信息完整
Highlights
- 所有代码示例均提供完整参数说明和错误处理上下文
- 工具来源明确(Together Python SDK、OpenAI SDK),覆盖主要使用场景
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Save or modify files
Confirm the output directory and whether existing files will be replaced. Back up important files and prefer a new output directory.
Mentioned in main document · lines 123 -
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 27 -
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 29, 41, 91, 169
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- api.together.xyz
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.