Saltar al contenido
TakoAPI
Volver a skills

tritonai-starter

por ucsd-cse-115-215

Aider
—Aún sin valoraciones
Tu valoración

Resumen

A guide for using UCSD's TritonAI LLM proxy with the OpenAI SDK and Aider Chat

Descripción

# TritonAI Starter Guide

## Using TritonAI in your Code

The TritonAI API key works exactly like the OpenAI SDK! You need to change two lines from what we've seen in class (`base_url` and `api_key`). Everything else (structured outputs, etc.) is the same as the [OpenAI docs](https://platform.openai.com/docs).

1. Setup

```bash
python -m venv .venv
source .venv/bin/activate
pip install openai python-dotenv
echo 'TRITON_API_KEY=your-secret-key' > .env
```

2. Using completions
```python
from dotenv import load_dotenv
from openai import OpenAI
import os

load_dotenv()

client = OpenAI(
    base_url="https://tritonai-api.ucsd.edu/v1",
    api_key=os.environ["TRITON_API_KEY"],
)

response = client.chat.completions.create(
    model="api-gpt-oss-120b",
    messages=[
        {"role": "system", "content": "You are a poetry classifier."},
        {"role": "user",   "content": "Is this a poem?\n\nRoses are red,\nviolets are blue."},
    ],
)

print(response.choices[0].message.content)
```

You can run `client.models.list()` to see the full list of available models.

---

## Using TritonAI with Aider

[Aider](https://aider.chat) is an open-source AI coding assistant that runs in your terminal.
It can read, edit, and create files in your repo.

Note: Feel free to use any compatible coding agent!

1. Install
```bash
source .venv/bin/activate
pip install aider-chat
```

2. Create `.aider.conf.yml` in your project
```yaml
model: openai/api-gpt-oss-120b
openai-api-base: https://tritonai-api.ucsd.edu/v1
openai-api-key: your-secret-key
chat-history-file: .aider.chats/chat.md
restore-chat-history: false
```

Note: The `restore-chat-history` option is set to `false`, so your conversations get logged to `.aider.chats/chat.md`. Later, you can run a split on these, and use it to submit your transcripts.

3. Run
```bash
aider
```

Use `/help` to see available commands. For example, you can run  `/chat-mode ask` to ask a question about your codebase.

Instalación

Instala la skill desde https://github.com/ucsd-cse-115-215/tritonai-starter

Esta skill no está publicada en el registro de ClawHub. Pega el prompt en tu agente de programación — Claude Code, Cursor, Codex — y la instalará directamente desde el repositorio de origen.

Abrir el repositorio

Enlaces