Effortlessly generate LLM APIs by simply defining input and output schemas.
Project description
llmgen
Effortlessly generate LLM APIs by simply defining input and output schemas (by pydantic).
Quick Start
Example:
from llmgen import OpenAiApiFactory
factory = OpenAiApiFactory(
api_key="your api key here",
)
@llm.impl()
def make_joke(theme: str) -> str
"""generate a random short joke based on theme""" # just describe your api in docstring
...
# call it just like you implmented it.
res = make_joke('cat')
print(res)
# >>> "Why was the cat sitting on the computer? It wanted to keep an eye on the mouse!"
checkout /demo to see more example.
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
llmgen-0.4.0.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file llmgen-0.4.0.tar.gz
.
File metadata
- Download URL: llmgen-0.4.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.19 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d867d3c6a54670bf8ce7f166774c5d2d3ffd29068dccac181a750cdc4d83fefd |
|
MD5 | e7f4f04c4d539c72e176f59a0f537711 |
|
BLAKE2b-256 | 718fdd5fc7bd436368146b37d05d22292e2f1eeb983ab0f59bc6b6b6142479c6 |
File details
Details for the file llmgen-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: llmgen-0.4.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.19 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f82b4ea7d13406078069b040a2cd1d29daf694cf4e5c7e779fa5d0cd95b2b4e |
|
MD5 | 6f9de003b8941609b73a990bb82a8170 |
|
BLAKE2b-256 | cae597aeaacb4f82de8c9726530867130d92396a02b6388e858ff0a205f4a554 |