ZeroGPT is a Python library for interacting with AI APIs, providing capabilities for text and image generation.
| Feature | Description |
|---|---|
| 💬 Text Generation | Various models for diverse text outputs |
| 🎨 Image Creation | Generate images from textual descriptions |
| 🔓 Uncensored Mode | More unrestricted response capabilities |
| ⚡ Optimized Performance | Memory and data handling optimization |
| 📡 Stream Support | Real-time streamed data processing |
| 🔐 Secure Authentication | HMAC-SHA256 request signing |
pip install zerogptfrom zerogpt import Client
client = Client()📝 Simple Text Generation
# Simple request
response = client.send_message("Hi, how are you?")📋 Text Generation with Instructions
# Request with instruction
response = client.send_message(
"Tell me about space",
instruction="You are an astronomy expert"
)🔓 Uncensored Mode
# Using "uncensored" mode
response = client.send_message(
"Explain a complex topic",
uncensored=True
)🧠 Think Mode (Deep Reasoning)
# Using "think" mode (deeper reasoning)
response = client.send_message(
"Solve a difficult math problem",
think=True
)💭 Contextual Conversations
# With context
messages=[
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hello!"}
]
response = client.send_message(
messages,
think=True
)🖼️ Create Images
# Create image
result = client.create_image(
prompt="anime neko girl",
samples=1,
resolution=(768, 512),
seed=-1,
steps=50
)💾 Manage Generated Images
# Get generated image
image = client.get_image(result['data']['request_id'])
# Save image
image.download(['path/to/save/image.png'])
# View image
image.open()from zerogpt.utils.tools import image_to_prompt
resp = image_to_prompt('path/to/image.png')🗂️ Working with Dummy Context1
💾 Context Management
from zerogpt.utils.prompt import Dummy
# Create context
dummy = Dummy()
dummy.create(messages=[
{"role": "user", "content": "Hi"},
{"role": "assistant", "content": "Hello!"}
])
# Also possible for image generation
dummy = Dummy()
dummy.create(prompt='neko girl', steps=100)
# Save context
dummy.save("context.bin")
# Load context
dummy.load("context.bin")
# Use instead of messages:
# client.send_message(dummy)
# or
# client.create_image(dummy)| Parameter | Type | Required | Description |
|---|---|---|---|
input |
str or list |
✅ | Text prompt or list of messages |
instruction |
str |
❌ | System instruction |
think |
bool |
❌ | Use model with deeper reasoning |
uncensored |
bool |
❌ | Use unrestricted mode |
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt |
str |
✅ | Description of the desired image |
samples |
int |
❌ | Number of samples |
resolution |
tuple |
❌ | Image resolution (width, height) |
seed |
int |
❌ | Seed for reproducibility |
steps |
int |
❌ | Number of generation steps |
negative_prompt |
str |
❌ | Description of undesired elements |
| 🔐 | HMAC-SHA256 All requests are signed using HMAC-SHA256 for secure data transmission |
| ⏰ | Timestamp Authentication Prevents replay attacks with timestamp validation |
MIT License
Copyright (c) 2025 RedPiar
Made with ❤️ by RedPiar
Footnotes
-
Dummy is used to compress context and data in general, very useful for systems with low RAM. It can also be saved for even greater memory efficiency! ↩