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

Uploaded Source

Built Distribution

xnano-0.0.32-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xnano-0.0.32.tar.gz
  • Upload date:
  • Size: 8.9 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.32.tar.gz
Algorithm Hash digest
SHA256 dd358e4723f150186c045638a7e8fa83bb5ef1e1c7a066e5818970c56c051a76
MD5 bc1fa1a28d70359e8319de015defea7a
BLAKE2b-256 fe2a9687a08d0f77407fd4f5aa97c11f22f0a3921db0457ab498512106519c39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xnano-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 83.1 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.32-py3-none-any.whl
Algorithm Hash digest
SHA256 dd8144ee37c55f288b812f8f53454b59ed7a4f7113225a658727fcd67dd5deb1
MD5 e2e0b7852d527e3ea61b07796cd7f672
BLAKE2b-256 e30d7460e39f1a02f892b3d7a38992147159f31ccc6065890aa0c536c74fbbd7

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