-
-
Notifications
You must be signed in to change notification settings - Fork 12k
[Doc] Add AI Badgr framework integration documentation #30669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
miguelmanlyx
wants to merge
6
commits into
vllm-project:main
Choose a base branch
from
miguelmanlyx:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+83
−0
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
246d814
Initial plan
Copilot 6d7d805
[Doc] Add AI Badgr framework integration documentation
Copilot 20664fa
[Doc] Improve AI Badgr documentation with environment variable examples
Copilot 23246ce
Merge pull request #1 from miguelmanlyx/copilot/add-ai-badgr-provider
miguelmanlyx d42c2b7
Update docs/deployment/frameworks/aibadgr.md
miguelmanlyx 911e5a6
Update docs/deployment/frameworks/aibadgr.md
miguelmanlyx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # AI Badgr | ||
|
|
||
| [AI Badgr](https://aibadgr.com) is a budget-focused, OpenAI-compatible LLM provider offering tier-based model access. | ||
|
|
||
| AI Badgr can connect to vLLM as a backend to serve local models through its OpenAI-compatible API interface. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Set up the vLLM environment: | ||
|
|
||
| ```bash | ||
| pip install vllm | ||
| ``` | ||
|
|
||
| ## Deploy | ||
|
|
||
| ### Using vLLM as AI Badgr's Backend | ||
|
|
||
| 1. Start the vLLM server with a supported chat completion model, e.g.: | ||
|
|
||
| ```bash | ||
| vllm serve meta-llama/Llama-3.2-3B-Instruct --host 0.0.0.0 --port 8000 | ||
| ``` | ||
|
|
||
| 2. Configure AI Badgr to point to your vLLM endpoint: | ||
|
|
||
| - **Base URL**: `http://{your-vllm-host}:8000/v1` | ||
| - **API Key**: Use any non-empty string (vLLM doesn't require authentication by default) | ||
| - **Model**: Use the model name from your vLLM deployment (e.g., `meta-llama/Llama-3.2-3B-Instruct`) | ||
miguelmanlyx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Connecting to AI Badgr's API | ||
|
|
||
| If you want to connect to AI Badgr's hosted service instead, you can use any OpenAI-compatible client: | ||
|
|
||
| ```python | ||
| import os | ||
| from openai import OpenAI | ||
|
|
||
| # AI Badgr configuration using environment variables | ||
| client = OpenAI( | ||
| base_url=os.getenv("AIBADGR_BASE_URL", "https://aibadgr.com/api/v1"), | ||
| api_key=os.getenv("AIBADGR_API_KEY") | ||
| ) | ||
|
|
||
| # AI Badgr uses tier-based model names | ||
| # Tier models: basic, normal, premium (recommended) | ||
| response = client.chat.completions.create( | ||
| model="premium", # or "normal", "basic" | ||
| messages=[ | ||
| {"role": "user", "content": "Hello, how are you?"} | ||
| ], | ||
| temperature=0.7, | ||
| max_tokens=150 | ||
| ) | ||
|
|
||
| print(response.choices[0].message.content) | ||
| ``` | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| When using AI Badgr's hosted service, you can set these environment variables: | ||
|
|
||
| - `AIBADGR_API_KEY`: Your AI Badgr API key | ||
| - `AIBADGR_BASE_URL`: Base URL for AI Badgr API (default: `https://aibadgr.com/api/v1`) | ||
|
|
||
| !!! note "Budget/Utility Provider" | ||
| AI Badgr is positioned as a budget-focused utility provider. The tier-based pricing model (basic/normal/premium) allows cost optimization based on your use case. | ||
|
|
||
| ## Model Tiers | ||
|
|
||
| AI Badgr offers tier-based model access: | ||
|
|
||
| - **basic**: Budget-tier models for simple tasks | ||
| - **normal**: Balanced performance and cost | ||
| - **premium**: Recommended default for most applications | ||
|
|
||
| Advanced users can also use specific model names for reproducibility or when they need to target exact model versions: | ||
|
|
||
| - `phi-3-mini` (maps to basic tier) | ||
| - `mistral-7b` (maps to normal tier) | ||
| - `llama3-8b-instruct` (maps to premium tier) | ||
|
|
||
| OpenAI model names (e.g., `gpt-3.5-turbo`) are also accepted and mapped automatically by AI Badgr to equivalent tier models. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.