Skip to main content

AI that works out of the box.

Project description

[!WARNING] Project is in its early stage of development. Current version is not stable.

🐈‍⬛ 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 is 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.

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

nyai-0.0.1.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file nyai-0.0.1.tar.gz.

File metadata

  • Download URL: nyai-0.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for nyai-0.0.1.tar.gz
Algorithm Hash digest
SHA256 22539b1fe3337a223c1fb0252a36cc2c361bd761853b04f784421b8da5d677fa
MD5 266b6f316bf9137bce5793ed94f2dbb1
BLAKE2b-256 12219df6aef7552b28ca9531cd7192a5b51f26b84377e987417f74a23fef6afb

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