LLM-Pool
This simple project is to manage multiple LLM(Large Language Model)s in one place. Because there are too many fine-tuned LLMs, and it is hard to evaluate which one is bettern than others, it might be useful to test as many models as possible. Below is the two useful usecases that I had in mind when kicking off this project.
- compare generated text from different models side by side
- complete conversation in collaboration of different models
Usecase
from llmpool import LLModelPool
from llmpool import LocalLoRAModel
from llmpool import RemoteTxtGenIfLLModel
from transformers import AutoModelForCausalLM
model_pool = LLModelPool()
model_pool.add_models(
# alpaca-lora 13b
LocalLoRALLModel(
"alpaca-lora-13b",
"elinas/llama-13b-hf-transformers-4.29",
"LLMs/Alpaca-LoRA-EvolInstruct-13B",
model_cls=AutoModelForCausalLM
),
RemoteTxtGenIfLLModel(
"stable-vicuna-13b",
"https://...:8080"
),
)
for model in model_pool:
result = model.batch_gen(
["hello world"],
GenerationConfig(...)
)
print(result)
_, stream_result = model.stream_gen(
"hello world",
GenerationConfig(...)
)
for ret in stream_results:
if instanceof(model, LocalLoRALLModel) or \
instanceof(model, LocalLLModel):
print(ret, end='')
else:
print(ret.token.text, end='')
Alternatively, you can organize the model pool with yaml file
from llmpool import instantiate_models
model_pool = instantiate_models('...yaml')
Todo
- Add example notebooks
- Yaml parser to add models to model pool
Metadata
Release files for llmpool 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llmpool-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for llmpool-0.2.2-py3-none-any.whl |
Release files / llmpool-0.2.2-py3-none-any.whl
| Download URL | llmpool-0.2.2-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4856c17b43f9d7de069619be5cfc82dee9733d41e2c2d110b6cf79d328115fb
|
|
BLAKE2b-256 checksum How to use checksums |
8cd3f270f3a6f85354394eb9b4375c4c0b1a7830cbded4cf0e8d48fe57c9ece4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for llmpool 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.