Skip to main content

Effortlessly generate LLM APIs by simply defining input and output schemas.

Project description

llmgen

PyPI

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


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 hashes)

Uploaded Source

Built Distribution

llmgen-0.4.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page