Python Interface for AIHorde
Project description
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 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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
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
Built Distribution
File details
Details for the file horde-client-1.0.2.tar.gz
.
File metadata
- Download URL: horde-client-1.0.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f3ad4bf479bfbdb6d5348f88779309cd005bd9a8b9cf340dff10482be4240e |
|
MD5 | d6bd08ee4df7cc1fcd84a8849183a1fc |
|
BLAKE2b-256 | bfffba0aa1bbcddb77d50417abd762c5fca6ff2b659052ee0c70de6a84c7c62c |
File details
Details for the file horde_client-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: horde_client-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce034bf884cb928229c35ac9fb3c9d73c4e6668e23838fc81744ca06d6cff13e |
|
MD5 | 9aa81332bb0f53212616438f031edc1c |
|
BLAKE2b-256 | 48f9cb3bb4555184bdbce5b06aae3abdfcafc32b5c39ce769f5c83e166e7aa44 |