Skip to content

RedPiarOfficial/ZeroGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– ZeroGPT


πŸ“š ZeroGPT Mini Docs

ZeroGPT is a Python library for interacting with AI APIs, providing capabilities for text and image generation.


✨ Features

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

πŸš€ Installation

pip install zerogpt

πŸ› οΈ Usage

πŸ”§ Client Initialization

from zerogpt import Client
client = Client()

πŸ’¬ Text Generation

πŸ“ 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
)

🎨 Image Generation

πŸ–ΌοΈ 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()

πŸ”„ Image to Prompt

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)

βš™οΈ Parameters

πŸ“€ send_message

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

🎨 create_image

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

πŸ”’ Security

πŸ” HMAC-SHA256
All requests are signed using HMAC-SHA256 for secure data transmission
⏰ Timestamp Authentication
Prevents replay attacks with timestamp validation

πŸ“‹ Requirements

Python


πŸ“„ License

MIT License

Copyright (c) 2025 RedPiar


πŸ‘¨β€πŸ’» Author

Telegram


Made with ❀️ by RedPiar

Footnotes

  1. 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! ↩

About

Python client for interacting with API and generating images.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages