Skip to main content

build extremely 'nano' llm workflows

Project description

xnano

pip install xnano

Examples

The most extensive llm completion function any library provides

import xnano as x

response = x.completion(
    # messages can be a list of messages or just a string
    # you can also pass a list of lists of messages to create batch completions
    messages = "what os am i running?",

    # any litellm model is supported
    model = "openai/gpt-4o-mini",

    # tools can be python functions, pydantic models, openai functions or even strings!
    # string tools are generated & optionally executed at runtime in a sandboxed environment
    tools = ["run_cli_command"],

    # automatically run tools!
    run_tools = True,

    # structured responses with instructor!
    # response models can be defined as pydantic models, or just like tools; even strings, lists of strings & dictionaries!
    # you can also pass in a generic type into the list or as is (str, int, etc...)
    response_model = ["operating_system", "version"]
)

print(response)
# OUTPUT
Response(operating_system='Darwin', version='23.6.0')

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

xnano-0.0.41.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

xnano-0.0.41-py3-none-any.whl (103.6 kB view details)

Uploaded Python 3

File details

Details for the file xnano-0.0.41.tar.gz.

File metadata

  • Download URL: xnano-0.0.41.tar.gz
  • Upload date:
  • Size: 9.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for xnano-0.0.41.tar.gz
Algorithm Hash digest
SHA256 02d0d2c8321a19a74c7715be653289a2dd8da56b244b75a8298f785515ee4570
MD5 984bb9184680c4717d7f4a46572ad044
BLAKE2b-256 aae5b51ddd767046f0ac3bb541687773138220d9770465fe9e4b8517165d2e49

See more details on using hashes here.

File details

Details for the file xnano-0.0.41-py3-none-any.whl.

File metadata

  • Download URL: xnano-0.0.41-py3-none-any.whl
  • Upload date:
  • Size: 103.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for xnano-0.0.41-py3-none-any.whl
Algorithm Hash digest
SHA256 2589c2e4ade160f3c6fba73214cf1040386e7c05292c4e8d88a2d81d22332f29
MD5 bbc77b410e3e4bdbca5f7fe0d7e33870
BLAKE2b-256 23c9defcbcea689276672d51647b7014a79c17be3b41d84750ef137c48f10c1f

See more details on using hashes here.

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