Pular para o conteúdo principal

Como o Together AI funciona

O Together AI facilita a execução de modelos open-source líderes usando apenas algumas linhas de código. A plataforma fornece inferência rápida, APIs compatíveis com OpenAI e acesso a modelos de ponta como Llama 4, DeepSeek e mais. Desenvolvido para desenvolvedores que precisam de uma infraestrutura de IA confiável e escalável sem a complexidade.

Modelos Recomendados

Recomendamos bons modelos de codificação com janelas de contexto grandes e preços competitivos.
Para as informações mais atualizadas, visite a página de preços do Together AI.
ModeloPreço (1M tokens)Janela de Contexto
Llama 4 Maverick recomendado0.27/0.27/0.85~128k tokens
DeepSeek-V3$1.25~128k tokens
Llama 3.1 70B Turbo$0.88~128k tokens
Qwen 2.5 72B$1.20~128k tokens

Criando uma Chave de API

Uma conta Together AI é necessária para criar uma Chave de API.
Acesse diretamente o Console Together AI para criar uma nova Chave de API. Ou siga estes passos:
  1. Crie uma conta em api.together.ai ou faça login se já tiver uma
  2. No painel principal, role para baixo até a seção “Gerenciar Conta”
  3. No cartão “Chaves de API”, clique no botão “Gerenciar Chaves”
  4. Clique no botão “Adicionar Chave”
  5. Dê um nome como ‘Kodus’ ou qualquer nome descritivo
  6. Copie sua chave de API e pronto!
Novas contas recebem $1 de crédito para começar gratuitamente.

Como usar

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.

Configurar o Together AI no Arquivo de Ambiente

Edite o seu arquivo .env e configure as definições principais. Para a Integração de LLM, use o Together AI no Modo Fixo:
# Configurações Principais do Sistema (atualize com seus domínios)
WEB_HOSTNAME_API="kodus-api.yourdomain.com"    
WEB_PORT_API=443                               
NEXTAUTH_URL="https://kodus-web.yourdomain.com"

# Chaves de Segurança (gere com os comandos openssl acima)
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"

# Configuração do Banco de Dados
API_PG_DB_PASSWORD="your-secure-db-password"
API_MG_DB_PASSWORD="your-secure-db-password"

# Configuração Together AI (Modo Fixo) 
API_LLM_PROVIDER_MODEL="meta-llama/Meta-Llama-4-Maverick-Instruct"  # Escolha seu modelo preferido
API_OPENAI_FORCE_BASE_URL="https://api.together.xyz/v1"             # URL da API Together AI  
API_OPEN_AI_API_KEY="your-together-api-key"                         # Sua Chave de API Together AI

# Webhooks do Provedor Git (escolha seu provedor)
API_GITHUB_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/github/webhook"
# ou API_GITLAB_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/gitlab/webhook"
# ou GLOBAL_BITBUCKET_CODE_MANAGEMENT_WEBHOOK="https://kodus-api.yourdomain.com/bitbucket/webhook"
As URLs de webhook devem alcançar o serviço de Webhooks (porta 3332). Use um domínio dedicado para webhooks ou roteie /.../webhook para a porta 3332 no seu proxy reverso.
O Modo Fixo é ideal para o Together AI porque ele fornece APIs compatíveis com OpenAI com preços competitivos e acesso a modelos open-source de ponta.

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.

Configurar Proxy Reverso (Para Produção)

Para webhooks e acesso externo, configure o Nginx:
# Aplicação Web (porta 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 (porta 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;
    }
}

Verificar a Integração com o Together AI

Além da verificação básica de instalação, confirme que o Together AI está funcionando:
# Verificar especificamente a conexão com a API Together AI
docker-compose logs api worker | grep -i together
Para informações detalhadas sobre configuração de SSL, monitoramento e configurações avançadas, consulte nosso guia completo de implantação.

Solução de problemas

  • Verifique se sua chave de API está correta e ativa no Console Together AI
  • Verifique se você tem créditos suficientes na sua conta Together AI
  • Certifique-se de que não há espaços extras no seu arquivo .env
  • Novas contas recebem $1 em créditos gratuitos
  • Verifique se o nome do modelo está escrito corretamente na sua configuração
  • Verifique se o modelo está disponível na biblioteca de modelos atual do Together AI
  • Tente com um modelo diferente da nossa lista recomendada
  • Consulte a documentação de modelos do Together AI
  • Verifique se o seu servidor tem acesso à internet para alcançar api.together.xyz
  • Verifique se há restrições de firewall
  • Revise os logs da API/worker para mensagens de erro detalhadas
  • Certifique-se de que está usando o endpoint de API correto
  • O Together AI fornece limites de taxa generosos (até 6000 requisições/min para LLMs)
  • Verifique seu uso atual no painel do Together AI
  • Considere fazer upgrade para um plano superior para aumentar os limites
  • Monitore seus padrões de uso para otimizar as chamadas de API