कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

tritonai-starter

ucsd-cse-115-215 द्वारा

Aider
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

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

विवरण

# 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.

इंस्टॉलेशन

https://github.com/ucsd-cse-115-215/tritonai-starter से यह स्किल इंस्टॉल करो

यह स्किल ClawHub रजिस्ट्री पर पब्लिश नहीं है। प्रॉम्प्ट को अपने कोडिंग एजेंट — Claude Code, Cursor, Codex — में पेस्ट करें, और वह स्किल को सीधे सोर्स रिपॉज़िटरी से इंस्टॉल कर देगा।

रिपॉज़िटरी खोलें

लिंक