Skip to main content

🐈‍⬛ nyai

Versative AI client and toolkit that works out of the box. Work with AI models from different providers seamlessly. Powered by OpenAI's Python SDK behind the scenes to handle dozens of AI providers without all the complexity.

Supports the following out of the box:

  • OpenAI
  • SambaNova
  • Anthropic
  • Cohere
  • Fireworks
  • Together
  • Vertex AI

📦 Setup

pip install nyai

🛠️ Usage

Set up a base client from one of the supported providers.

from nyai import Client

client = Client(provider="sambanova",
                api_key="API_KEY")

Extend these clients with better functionality.

from nyai.llm import LLM

llm = LLM(client, model="Meta-Llama-3.2-3B-Instruct")
for chunk in llm.stream("Tell me a joke"):
    print(chunk, end="")

Want to add your own Provider?

from nyai.providers import Provider
from nyai import Client

perplexity = Provider(name="Perplexity", endpoint="https://api.perplexity.ai")
client = Client(provider=perplexity, api_key="API_KEY")

Docs to be continued...

🎯 Motivation

Handling LLMs or other AI models from different providers should be easy. Nyai aims to be a dirt simple solution and toolkit that makes interactions with multiple AI providers seamless. Why not use LangChain instead? Why would you do that to yourself. Nyai was also originally built for Openmacro.

Metadata

Release files for nyai 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nyai 0.0.2
File Size Uploaded Provenance Actions
nyai-0.0.2.tar.gz 6.9 kB Without provenance Details for nyai-0.0.2.tar.gz

Release files / nyai-0.0.2.tar.gz

Download URL nyai-0.0.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
481726ef5ff5452a7fcaa26ed5dcfe43841d3ccb971662bbfed88b190eeb567c
BLAKE2b-256 checksum
How to use checksums
76a4afce06bf65e24e9cf817b68d1d69c1edbfd1b0f01cf3c757c34b2751c9ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.13.0

Security for nyai 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page