A library for managing LLM models
Project description
Description
ModelhubClient: A Python client for the Modelhub API
Installation
Install from PyPI
pip install puyuan_modelhub
Install from source
git clone https://github.com/puyuantech/modelhub
python setup.py build bdist_wheel
pip install dist/*.whl
Usage
Client side
Initialize a ModelhubClient
from modelhub import ModelhubClient
client = ModelhubClient(
host="http://*****:*****/", user_name="****", user_password="*****"
)
Get supported Models
client.supported_models
Get model supported params
client.get_supported_params("Minimax")
Chat with model
client.chat("Hello?", model="m3e")
Get model embeddings
client.get_embeddings(["你好", "Hello"], model="m3e")
Server side
Start server in 4 lines:
from modelhub.server import start_server
import yaml
# load config
config = yaml.xxxx
# start server
start_server(config)
config file example:
from modelhub.server import start_server
import yaml
# load config
config = yaml.xxxx
# start server
start_server(config)
Chat Params:
class ChatParams(BaseModel):
prompt: str
model: str
auth: AuthParams
stream: bool = True
parameters: Dict[str, Any] = {}
Examples
Contact
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
puyuan-modelhub-1.0.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for puyuan_modelhub-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6788273dee30913431b44a926bbfce3d907ee7e244b7f065a8a8d4a89e7da60 |
|
MD5 | 7faac05150666a27add52e240cb6d01c |
|
BLAKE2b-256 | aa87195124c076eb48563d5cdd0417e52725a45c46e4256755148acba3078563 |