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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: xnano-0.0.38.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.38.tar.gz
Algorithm Hash digest
SHA256 aa43a6b05f5e79eabb230821402e352a9aaefd5493e0134d0afec560402b1238
MD5 0309ab06e5af8623792195bbd6235e07
BLAKE2b-256 c5f07d10eaa2aae161f9a2e7e7aa185213adb2211bfe1ab3e6c9dc96189addb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xnano-0.0.38-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.38-py3-none-any.whl
Algorithm Hash digest
SHA256 242fa68784b84de1ada50933a019e01eab08c3c2f9991aa4b218783138677e99
MD5 6c7e9789dd431839584d24feb53d4730
BLAKE2b-256 75a86d32d4c2c88132c4628d36d95d9a09fa767510b49fcc97f21f21c58b69d4

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