together-ai
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "together-ai":https://skillpi.com/zh/skills/deepskill-fe790398623c05c2879741248cf3b112146cc260217af34331dacb17e2c69f41。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
运行开源 AI 模型的云平台,提供 LLM、图像模型和嵌入模型的推理 API。支持在自定义数据上微调、兼容 OpenAI 的 API 格式,并提供具有竞争力的开源模型托管定价。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
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
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 Together AI 云平台的完整使用指南,涵盖 LLM 推理、图像生成、嵌入模型、微调等核心功能
- 面向开发者群体,具有明确的技术实用价值,属于通用工具类
待提升项
-
description写错位置 原报告严重程度:轻微
顶层 description 字段内容与 skill_body 内部 frontmatter 重复,存在冗余
改进建议:建议将顶层 description 字段留空,仅保留 skill_body 内部的 frontmatter description
亮点
- 文档结构清晰,包含 Installation、各功能模块、Key Concepts 等完整章节
- 每个模块均提供完整代码示例和详细说明,frontmatter 信息完整
亮点
- 所有代码示例均提供完整参数说明和错误处理上下文
- 工具来源明确(Together Python SDK、OpenAI SDK),覆盖主要使用场景
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
保存或修改文件
先确认输出目录和同名文件是否会被覆盖;重要文件保留备份,优先写入新的输出目录。
主文档提及 · 第 123 行 -
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 27 行 -
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 29, 41, 91, 169 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- api.together.xyz
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。