Skip to main content

Python Interface for AIHorde

Project description


Logo

Documentation Status

Easy-to-use Python Interface for KoboldAI Horde.
Report Bug · Request Feature

About

This project provides Python Client to interact with KoboldAI Horde service, which is a crowdsourced distributed cluster program that offers Image generation and Text Generation workers. Through this utility package, you can leverage these services from your application.

  • Simple & Easy-to-use
  • Support for Text & Image Generation
  • LangChain Integration
  • Asynchronous Client

Note: There is an official Python SDK under development from Haidra-org: https://github.com/Haidra-Org/horde-sdk.

Security Note: Do NOT send any private information while connecting to the public KoboldAI service. There is no control on how the data is processed. However, if you have private & secured KoboldAI Endpoints then feel free to experiment yourself.

Quickstart

Install Horde Client with pip:

pip install horde-client

Sample Code:

from horde_client import HordeClient, TextGenParams

# Initialize Client
client = HordeClient(
  # To access public KoboldAI service
  insecure=True 
)

# Prompt
prompt =  """### Instruction: 
Tell me a knock knock joke.

### Response:
"""

# Setup Text Generation Parameters
params = TextGenParams(
    max_context_length = 512,
    temperature=0.8
)

# Run Generation (Sync)
text_gen_ouput = client.text_gen(prompt, params=params)

print(text_gen_ouput.generations[0].text)
# Knock knock!
# Who's there?
# Interrupting cow.
# Interrupting cow who?
# Mooooooo!

Roadmap

  • Text Generation Support
  • LangChain/LlaMaIndex Integration
  • Image Generation Support
  • Asynchronous Client
  • Readthedocs integration
  • Tests

Missing Something? Raise a request

Contributing

Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

horde-client-1.0.3.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

horde_client-1.0.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file horde-client-1.0.3.tar.gz.

File metadata

  • Download URL: horde-client-1.0.3.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for horde-client-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6282be01b1e2e74c524d85a151b3180bb6178b6dc466f9356ee7bded41fbfcd9
MD5 9fe297f762ff71bedc6665d63c6958fb
BLAKE2b-256 844d2568e8f6d97c65a7e66c026df19aff4875cea7a7bdc10863953fad1395d2

See more details on using hashes here.

File details

Details for the file horde_client-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: horde_client-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for horde_client-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 482e04bf3d0bbe26b9b08d034ba3c61b61387f25cd44f24b7d74fca22cb70053
MD5 e9e6646ca5397b60f095b0340f926102
BLAKE2b-256 54a2612c7382ce85b8e97e62b8e3f24c3fbed2da08ed35f67710d9f6fd86952b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page