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.35.tar.gz (9.0 MB view details)

Uploaded Source

Built Distribution

xnano-0.0.35-py3-none-any.whl (103.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xnano-0.0.35.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.35.tar.gz
Algorithm Hash digest
SHA256 c97515c93bd283fac865123b4f383a2f5029e1fcaf8c4473e026b236b76e4f8c
MD5 edbbf03e8e5b134ee618597e5aa8a4bd
BLAKE2b-256 f63468c5cf2491bbeb0ef9edbfc43f211de7df0a5a98f29ca99dbfb384bfc297

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xnano-0.0.35-py3-none-any.whl
  • Upload date:
  • Size: 103.4 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.35-py3-none-any.whl
Algorithm Hash digest
SHA256 308a7356929bef74c5964a066727dbb82d5dbff61b131094f131f48d826c8cca
MD5 725c2fb24e35766d8eb4443ad9812e9a
BLAKE2b-256 e3f128ad4dce6dcb9e7ae7cbb5d914e31170ced8f18f93492f2029a45fc25184

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