Structured queries from local or online LLM models
Project description
Sibila
Extract structured data from remote or local file LLM models.
- Extract data into Pydantic objects, dataclasses or simple types.
- Same API for local file models and remote OpenAI models.
- Model management: download models, manage configuration and quickly switch between models.
- Tools for evaluating output across local/remote models, for chat-like interaction and more.
See What can you do with Sibila?
To extract structured data from a local model:
from sibila import Models
from pydantic import BaseModel
class Info(BaseModel):
event_year: int
first_name: str
last_name: str
age_at_the_time: int
nationality: str
model = Models.create("llamacpp:openchat")
model.extract(Info, "Who was the first man in the moon?)
Returns an instance of class Info, created from the model's output:
Info(event_year=1969,
first_name='Neil',
last_name='Armstrong',
age_at_the_time=38,
nationality='American')
Or to use OpenAI's GPT-4, we would simply replace the model's name:
model = Models.create("openai:gpt-4")
model.extract(Info, "Who was the first man in the moon?")
If Pydantic BaseModel objects are too much for your project, Sibila supports similar functionality with Python dataclass.
Docs
The docs explain the main concepts, include examples and an API reference.
Installation
Sibila can be installed from PyPI by doing:
pip install sibila
See Getting started for more information.
Examples
The Examples show what you can do with local or remote models in Sibila: structured data extraction, classification, summarization, etc.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Sibila wouldn't be be possible without the help of great software:
Thank you!
Sibila?
Sibila is the Portuguese word for Sibyl. The Sibyls were wise oracular women in ancient Greece. Their mysterious words puzzled people throughout the centuries, providing insight or prophetic predictions.
Michelangelo's Delphic Sibyl, in the Sistine Chapel ceiling.
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 sibila-0.3.2.tar.gz
.
File metadata
- Download URL: sibila-0.3.2.tar.gz
- Upload date:
- Size: 63.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f2c6b8dd473a9ac2b5d02023d30e6cffd18f23682146729bb2be302820b16b |
|
MD5 | bade2e258f62436f6e535d929c692d17 |
|
BLAKE2b-256 | fa58887cae0d1d49d4131cd01a39d363f5cd4bfc5ce25d0a730a45538c15c1d4 |
File details
Details for the file sibila-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: sibila-0.3.2-py3-none-any.whl
- Upload date:
- Size: 65.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f2fa71bca8eefd215a8bab9243baf339b7a9be49edfeea9712c735cd2fb6edd |
|
MD5 | 7cd349e73ba4d17137ed05e46634a71a |
|
BLAKE2b-256 | f37ed19fba726f9f3ee8a75a9c16d340632b41a153bac9cd1de14ad236bc8ef0 |