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.0.tar.gz
(6.4 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.0.tar.gz.
File metadata
- Download URL: nanogpt_sdk-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05c9290f0efcf32558497a7c1a69475f13b221065277ac4beb283cb33d7aba8f
|
|
| MD5 |
478e933ad015a94e3e521688f1cac6b4
|
|
| BLAKE2b-256 |
71f273b0faf2c9af9bc7762c12be0ac7785aabc8b1b6bbff692693409efc807c
|
File details
Details for the file nanogpt_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nanogpt_sdk-0.1.0-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.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b35d34f3c4adf218a986b196c3097832bdba33946af4b27a683b0a91f3eefda
|
|
| MD5 |
22ba1eccd6e7cc89b2c151a5d97b9eae
|
|
| BLAKE2b-256 |
816b0acac54d96cef70f5d1f609359b82c7663459238d1eac8b5340b28d1edcb
|