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
Release history Release notifications | RSS feed
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.36.tar.gz
(9.0 MB
view details)
Built Distribution
xnano-0.0.36-py3-none-any.whl
(103.6 kB
view details)
File details
Details for the file xnano-0.0.36.tar.gz
.
File metadata
- Download URL: xnano-0.0.36.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 102eac54a4c0a02090eabf71ba6fe50841dfa496c51d21065a0ac12ba90fd535 |
|
MD5 | f9df4769978fc617741b7df1a9df2096 |
|
BLAKE2b-256 | 1b1c1904f6cba2f319e8992e8257c12543a480ed4e497fc228b283277e933f55 |
File details
Details for the file xnano-0.0.36-py3-none-any.whl
.
File metadata
- Download URL: xnano-0.0.36-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a193986cec1ea53d1143857361b4ddf437af6561c1569153b6e746ee3271e9b6 |
|
MD5 | 8ae6c6e67b2878a747cce735a25e19d6 |
|
BLAKE2b-256 | cca8d10ed2278f64e37aa801a46849c8b5d1f97b6443d043b7bb0b5105cc8bd9 |