Python client for the NanoGPT API
Project description
NanoGPT SDK
A clean Python client for the NanoGPT API.
Supports text completions, chat completions, image and video generation, and model listing.
Installation
pip install nanogpt-sdk
Quickstart
from nanogpt import Client, BearerAuth, endpoints
# Initialize
client = Client(BearerAuth('YOUR_API_KEY'))
# Create a chat completion
response = endpoints.chat.create_completion(
client,
model = 'gpt-nano-1',
messages = [
{'role': 'system', 'content': 'You are a helpful assistant.'},
{'role': 'user', 'content': 'Why is the sky blue?'}
],
temperature = 0.7,
max_tokens = 256
)
# Print generated text
print(response['choices'][0]['message']['content'])
Endpoints
| Module | Description |
|---|---|
endpoints.chat |
Create chat completions (OpenAI-style message schema) |
endpoints.completions |
Generate free-form text completions |
endpoints.models |
List available public or subscription models |
endpoints.images |
Generate images from text prompts |
endpoints.videos |
Generate videos from text prompts |
Development
git clone https://github.com/kalenmcmillan/nanogpt-sdk.git
cd nanogpt-sdk
python -m pip install -e .
pytest
License
MIT License © 2025 Kalen McMillan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nanogpt_sdk-0.1.1.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nanogpt_sdk-0.1.1.tar.gz.
File metadata
- Download URL: nanogpt_sdk-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5372bd88fdb56d6c7d8901802bef2e400fe61193ad8e81af599410c0e7c559b6
|
|
| MD5 |
2cc864540022bcbaec0893ad8111ca1d
|
|
| BLAKE2b-256 |
42b89d84fabe350b2d0f2d96873e36b038bfe4fa68436411515ea681f461138d
|
File details
Details for the file nanogpt_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nanogpt_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75bc4c727e22c851370dda3c50c235867a81cf3d5ec42155c98dd64e546ecd60
|
|
| MD5 |
bdcf3f8ed2997940e2bc4f4c01ae4ad4
|
|
| BLAKE2b-256 |
c237f189b941e62f8591006812876349769ccb949555210d8f6a7438f7d6429a
|