GithubAIPy
They released this recently, so why not make a wrapper of it, to use everywhere !
A Python package to interact with GitHub AI models. Easily authenticate and query AI models using a simple and intuitive interface.
Installation
Install the package via pip:
pip install GithubAIPy
Quick Guide: Get GitHub Bearer Token Using Chrome DevTools
Go to: https://github.com/marketplace/models/azure-openai/gpt-4o/playground.
Open DevTools: F12 → Network tab.
Send a message in the playground.
In DevTools, find the completions request → check Headers → copy the Authorization: Bearer value.
⚠️ Warning: Keep your token private!
To use it, just put the full cookie with bearer before !
Usage
Authentication
authenticate using your GitHub Bearer token:
from GithubAIPy import login
login("your_bearer_token_here")
Querying a Model
Use the ask function to send a query to a specific AI model:
from GithubAIPy import ask
response = ask("Meta-Llama-3-70B-Instruct", "What is the capital of France?")
print(response)
Streaming Responses
Ask function supports streaming responses for real-time interaction:
response = ask("Meta-Llama-3-70B-Instruct", "Explain quantum computing in simple terms.", stream=True)
Supported AI Models
Below is a list of supported AI models. You can use any of these models with the ask function.
Supported AI Models
Below is a list of supported AI models. You can use any of these models with the ask function.
| Model Name | ||
|---|---|---|
| gpt-4o | gpt-4o-mini | o1-mini |
| o1-preview | o3-mini | text-embedding-3-large |
| text-embedding-3-small | Phi-3.5-MoE-instruct | Phi-3.5-mini-instruct |
| Phi-3.5-vision-instruct | Phi-3-medium-128k-instruct | Phi-3-medium-4k-instruct |
| Phi-3-mini-128k-instruct | Phi-3-mini-4k-instruct | Phi-3-small-128k-instruct |
| Phi-3-small-8k-instruct | Phi-4 | AI21-Jamba-1.5-Large |
| AI21-Jamba-1.5-Mini | Codestral-2501 | Cohere-command-r |
| Cohere-command-r-08-2024 | Cohere-command-r-plus | Cohere-command-r-plus-08-2024 |
| Cohere-embed-v3-english | Cohere-embed-v3-multilingual | DeepSeek-R1 |
| Llama-3.2-11B-Vision-Instruct | Llama-3.2-90B-Vision-Instruct | Llama-3.3-70B-Instruct |
| Meta-Llama-3.1-405B-Instruct | Meta-Llama-3.1-70B-Instruct | Meta-Llama-3.1-8B-Instruct |
| Meta-Llama-3-70B-Instruct | Meta-Llama-3-8B-Instruct | Ministral-3B |
| Mistral-Large-2411 | Mistral-Nemo | Mistral-large |
| Mistral-large-2407 | Mistral-small | jais-30b-chat |
Examples
Example 1: Simple Query
response = ask("gpt-4o", "What is the meaning of life?")
print(response)
Example 2: Streaming Response
response = ask("Meta-Llama-3-70B-Instruct", "Explain the theory of relativity.", stream=True)
Example 3: Using a Different Model
response = ask("Mistral-Large-2411", "Write a Python function to calculate the Fibonacci sequence.")
print(response)
Contributing
Contributions are welcome! If you'd like to contribute, please follow these steps:
Fork the repository.
Create a new branch (git checkout -b feature/YourFeatureName).
Commit your changes (git commit -m 'Add some feature').
Push to the branch (git push origin feature/YourFeatureName).
Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support For issues or feature requests, please open an issue on the GitHub repository.
Metadata
Release files for GithubAIPy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| GithubAIPy-0.1.1.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| GithubAIPy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / GithubAIPy-0.1.1.tar.gz
| Download URL | GithubAIPy-0.1.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c334d5dc84ac6940231c5de56602316db478d3821cf4755eba0f65469cafa5ac
|
|
BLAKE2b-256 checksum How to use checksums |
f3c96c396ce1d2ea7b49b4e256db69455dfb61c8b0f2ddd31b6562ac23215a97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / GithubAIPy-0.1.1-py3-none-any.whl
| Download URL | GithubAIPy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fc0303069bb78bb61e960c1fc13f819c773b13e8d91d8254b94542b436705a7
|
|
BLAKE2b-256 checksum How to use checksums |
2bea2e43a9e2b5c18ae4b271d5d81e66f9b785855d07efe926f6f87ed8357d7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|