メインコンテンツへスキップ

Together AIの動作方法

Together AIは数行のコードで主要なオープンソースモデルを簡単に実行できるプラットフォームです。高速推論、OpenAI互換API、Llama 4、DeepSeekなどの最先端モデルへのアクセスを提供します。複雑さなしに信頼性の高いスケーラブルなAIインフラが必要な開発者のために構築されています。

推奨モデル

高いコンテキストウィンドウと競争力のある価格を持つ優れたコーディングモデルを推奨します。
最新情報については、Together AIの価格ページを参照してください。
モデル価格(トークン100万当たり)コンテキストウィンドウ
Llama 4 Maverick 推奨0.27/0.27/0.85約128kトークン
DeepSeek-V3$1.25約128kトークン
Llama 3.1 70B Turbo$0.88約128kトークン
Qwen 2.5 72B$1.20約128kトークン

APIキーの作成

APIキーを作成するにはTogether AIアカウントが必要です。
Together AIコンソールに直接アクセスして新しいAPIキーを作成します。 または、以下の手順に従ってください:
  1. api.together.aiでアカウントを作成するか、既にある場合はログインします
  2. メインダッシュボードで「アカウント管理」セクションまでスクロールします
  3. 「APIキー」カードで「キーを管理」ボタンをクリックします
  4. 「キーを追加」ボタンをクリックします
  5. 「Kodus」または任意の説明的な名前を付けます
  6. APIキーをコピーして準備完了です!
新しいアカウントには$1のクレジットが付いて無料で始められます。

使用方法

System Requirements

  • Docker (latest stable version)
  • Node.js (latest LTS version)
  • Yarn or NPM (latest stable version)
  • Domain name or fixed IP (for external deployments)
  • 3000: Kodus Web App
  • 3001: API
  • 3332: Webhooks
  • 5672, 15672, 15692: RabbitMQ (AMQP, management, metrics)
  • 3101: MCP Manager (API, metrics)
  • 5432: PostgreSQL - 27017: MongoDB
Internet access is required if you plan to connect to cloud-based Git services (GitHub, GitLab, Bitbucket) or cloud LLM providers (OpenAI, Anthropic, etc.). For self-hosted Git tools and on-prem LLMs within your network, external internet access is optional.

Domain Name Setup (Optional)

If you're planning to integrate Kodus with cloud-based Git providers (GitHub, GitLab, or Bitbucket), you'll need public-facing URLs for both the Kodus Web App and its API. This allows your server to receive webhooks for proper Code Review functionality and ensures correct application behavior. We recommend setting up two subdomains:
  • One for the Web Application, e.g., kodus-web.yourdomain.com.
  • One for the API, e.g., kodus-api.yourdomain.com.
Webhooks are handled by a separate service (port 3332). You can either:
  • Use a dedicated webhooks subdomain, e.g., kodus-webhooks.yourdomain.com, or
  • Keep using the API domain and route /github/webhook, /gitlab/webhook, etc. to the webhooks service in your reverse proxy.
Both subdomains should have DNS A records pointing to your server's IP address. Later in this guide, we will configure a reverse proxy (Nginx) to route requests to these subdomains to the correct internal services. This setup is essential for full functionality, including webhooks and authentication.
Note: If you're only connecting to self-hosted Git tools on your network and do not require public access or webhooks, you might be able to use a simpler setup, but this guide focuses on public-facing deployments.

Setup

1

Clone the installer repository

git clone https://github.com/kodustech/kodus-installer.git
cd kodus-installer
2

Copy the example environment file

cp .env.example .env
3

Generate secure keys for the required environment variables

./generate-keys.sh
4

Edit the environment file

Edit .env with your values using your preferred text editor.
nano .env
See Environment Variables Configuration for detailed instructions.
5

Run the installer

./scripts/install.sh
6

Success 🎉

When complete, Kodus Services should be running on your machine. You can verify your installation using the following script:
./scripts/doctor.sh
7

Access the web interface

Once you access the web interface for the first time, you'll need to:
  1. Create your admin account - This will be the first user with full system access
  2. Configure your Git provider - Connect GitHub, GitLab, or Bitbucket following the on-screen instructions
  3. Select repositories for analysis - Choose which code repositories Kody will review
For detailed steps on the initial configuration process, refer to our Getting Started Guide.

環境ファイルでTogether AIを設定する

.env ファイルを編集してコア設定を構成します。LLMインテグレーションには、Together AIを固定モードで使用します:
# コアシステム設定(ドメインを更新)
WEB_HOSTNAME_API="kodus-api.yourdomain.com"    
WEB_PORT_API=443                               
NEXTAUTH_URL="https://kodus-web.yourdomain.com"

# セキュリティキー(上記のopensslコマンドで生成)
WEB_NEXTAUTH_SECRET="your-generated-secret"
WEB_JWT_SECRET_KEY="your-generated-secret"
API_CRYPTO_KEY="your-generated-hex-key"
API_JWT_SECRET="your-generated-secret"
API_JWT_REFRESHSECRET="your-generated-secret"

# データベース設定
API_PG_DB_PASSWORD="your-secure-db-password"
API_MG_DB_PASSWORD="your-secure-db-password"

# Together AI設定(固定モード) 
API_LLM_PROVIDER_MODEL="meta-llama/Meta-Llama-4-Maverick-Instruct"  # 好みのモデルを選択
API_OPENAI_FORCE_BASE_URL="https://api.together.xyz/v1"             # Together AI API URL  
API_OPEN_AI_API_KEY="your-together-api-key"                         # Together AI APIキー

# Gitプロバイダーのwebhook(プロバイダーを選択)
API_GITHUB_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/github/webhook"
# または API_GITLAB_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/gitlab/webhook"
# または GLOBAL_BITBUCKET_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/bitbucket/webhook"
WebhookのURLはWebhooksサービス(ポート3332)に到達できる必要があります。専用webhooksドメインを使用するか、リバースプロキシで /.../webhook をポート3332にルーティングします。
固定モードはTogether AIに最適です。競争力のある価格と最先端のオープンソースモデルへのアクセスを持つOpenAI互換APIを提供します。

Run the Installation Script

Looking for more control? Check out our docker-compose file for manual deployment options.
Set the proper permissions for the installation script:
chmod +x scripts/install.sh
Run the script:
./scripts/install.sh

What the Installer Does

Our installer automates several important steps:
  • Verifies Docker installation
  • Creates networks for Kodus services
  • Clones repositories and configures environment files
  • Runs docker-compose to start all services
  • Executes database migrations
  • Seeds initial data
🎉 Success! When complete, the Kodus Web App and backend services (API, worker, webhooks, MCP manager) should be running on your machine. You can verify your installation by visiting http://localhost:3000 - you should see the Kodus Web Application interface.
Code Review features will not work yet unless you complete the reverse proxy setup. Without this configuration, external Git providers cannot send webhooks to your instance.

リバースプロキシのセットアップ(本番環境向け)

WebhookとExternal Accessには、Nginxを設定します:
# Webアプリ(ポート3000)
server {
    listen 80;
    server_name kodus-web.yourdomain.com;
    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# API(ポート3001)  
server {
    listen 80;
    server_name kodus-api.yourdomain.com;
    location ~ ^/(github|gitlab|bitbucket|azure-repos)/webhook {
        proxy_pass http://localhost:3332;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location / {
        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Together AI統合の確認

基本的なインストール確認に加えて、Together AIが動作していることを確認します:
# Together AI API接続を具体的に確認
docker-compose logs api worker | grep -i together
SSLセットアップ、モニタリング、高度な設定の詳細については、完全なデプロイガイドを参照してください。

トラブルシューティング

  • APIキーがTogether AIコンソールで正しくアクティブであることを確認します
  • Together AIアカウントに十分なクレジットがあるか確認します
  • .env ファイルに余分なスペースがないことを確認します
  • 新しいアカウントには$1の無料クレジットが付きます
  • 設定のモデル名が正しくスペルされていることを確認します
  • Together AIのCurrentモデルライブラリでモデルが利用可能であることを確認します
  • 推奨リストの別のモデルで試してください
  • Together AIモデルドキュメントを確認します
  • サーバーが api.together.xyz にアクセスできるインターネット接続を持っていることを確認します
  • ファイアウォールの制限がないか確認します
  • 詳細なエラーメッセージについてAPI/ワーカーログを確認します
  • 正しいAPIエンドポイントを使用していることを確認します
  • Together AIはLLMに対して寛大なレート制限(最大6000リクエスト/分)を提供します
  • Together AIダッシュボードで現在の使用量を確認します
  • より高い制限のために上位ティアへのアップグレードを検討します
  • API呼び出しを最適化するために使用パターンを監視します