|
| 1 | +--- |
| 2 | +sidebar_position: 10 |
| 3 | +--- |
| 4 | + |
| 5 | +# GitHub Models Integration |
| 6 | + |
| 7 | +*Note: This is an internal technical blueprint for the VibeAuracle engineering team.* |
| 8 | + |
| 9 | +This document provides a technical blueprint for integrating AI capabilities using the **GitHub Models API**. While VibeAuracle supports multiple providers, this integration pattern is core to our "Universal API" strategy. |
| 10 | + |
| 11 | +## 1. Architecture Overview |
| 12 | + |
| 13 | +The integration follows a "Unified API" pattern. Instead of integrating multiple SDKs (OpenAI, Anthropic, Mistral), we use the **GitHub Models API**, which provides an OpenAI-compatible interface for dozens of leading models. |
| 14 | + |
| 15 | +### Key Components |
| 16 | +- **Model Manager**: Handles discovery and caching of available models. |
| 17 | +- **API Client**: Manages authentication and HTTP communication. |
| 18 | +- **Prompt Builder**: Structures application data into messages for the LLM. |
| 19 | + |
| 20 | +## 2. Authentication |
| 21 | + |
| 22 | +The API uses a standard GitHub Personal Access Token (PAT) as a Bearer token. No special SDK is required; standard HTTP headers are sufficient. |
| 23 | + |
| 24 | +## 3. Model Discovery & Caching |
| 25 | + |
| 26 | +One of the most powerful features of the GitHub Models API is the ability to dynamically discover available models. This allows VibeAuracle to automatically support new models as they are added to the platform. |
| 27 | + |
| 28 | +### Fetching Models |
| 29 | +The `/models` endpoint returns metadata for all available models, including their tasks (e.g., `chat-completion`). |
| 30 | + |
| 31 | +## 4. Inference Integration |
| 32 | + |
| 33 | +The core interaction uses a Chat Completion schema. This involves a `system` prompt to define behavior and a `user` prompt for the actual data. |
| 34 | + |
| 35 | +## 5. Advanced Capabilities |
| 36 | + |
| 37 | +### Multi-Model Support |
| 38 | +By using a unified API, users can switch between models like `gpt-4o`, `Phi-3`, or `Mistral-large` without code changes. |
| 39 | + |
| 40 | +### Context Compression |
| 41 | +When dealing with large inputs (like code diffs), it's essential to compress data to fit within token limits and reduce costs. |
| 42 | + |
| 43 | +### Streaming |
| 44 | +The API supports Server-Sent Events (SSE) for streaming responses, which we use in the TUI for real-time updates. |
0 commit comments