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
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22539b1fe3337a223c1fb0252a36cc2c361bd761853b04f784421b8da5d677fa |
|
MD5 | 266b6f316bf9137bce5793ed94f2dbb1 |
|
BLAKE2b-256 | 12219df6aef7552b28ca9531cd7192a5b51f26b84377e987417f74a23fef6afb |