A unified interface for interacting with various Language Model (LLM) providers
Project description
WORK IN PROGRESS | PLEASE DO NOT USE YET !!
I am still working on this, I don't have the package built yet, I recommend not to use this yet. I haven't tested it thoroughly, and will most probably break.
Ethina
Ethina is a powerful Python package that provides a unified interface for interacting with various Language Model (LLM) providers such as OpenAI, Anthropic, AWS Bedrock, Azure AI, Azure OpenAI, Google, and Ollama.
Features
- Unified API for multiple LLM providers
- Supports both streaming and non-streaming responses
- Easy-to-use client generation
- Consistent input and output formats across providers
- Customizable parameters for LLM interactions
Installation
To install Ethina, use pip:
pip install ethina
Quick Start
Here's a quick example using Azure OpenAI:
from ethina import AzureOpenAIClient, AzureOpenAIChat
# Create client
provider_keys = {
"base": "https://your-resource-name.openai.azure.com/",
"api_key": "your-api-key",
"api_version": "2024-05-01-preview"
}
client = AzureOpenAIClient(provider_keys)
# Create chat object
chat = AzureOpenAIChat(client)
# Prepare input data
input_data = {
"model": "your-deployment-name",
"messages": [
{"role": "user", "content": "What is Ethina?"}
],
"max_tokens": 800,
"temperature": 0.7
}
# Generate response
response = chat.generate(input_data)
print(response)
Supported Providers
- OpenAI
- Azure OpenAI
- Anthropic
- AWS Bedrock
- Azure AI
- Ollama
Documentation
For detailed usage instructions and API reference, please refer to the documentation.
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This version includes a more structured format, consistent code block styles, and links placeholders for documentation and contributing guide. Adjust the links as needed based on your actual documentation and contributing guide URLs.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ethina-0.1a0.tar.gz.
File metadata
- Download URL: ethina-0.1a0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
affd7cc34cffb63c49457b9c96daa36806486ba307f38d0e7cc118d7aa736d9b
|
|
| MD5 |
1c908a0a4918a4824aa6c2f9315f59d1
|
|
| BLAKE2b-256 |
a82675b46b324fe2ce55039736c7a81348325c2b62d28577b19cc9646d78d158
|
File details
Details for the file ethina-0.1a0-py3-none-any.whl.
File metadata
- Download URL: ethina-0.1a0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd17f0423baadac5d8dc0ad7fab72be590bbf948e2588128e5acb0e2b9171ab7
|
|
| MD5 |
4a0af0a76a30c906e868e48929820696
|
|
| BLAKE2b-256 |
8ef945b36f5a895bcceae14a08806c2135a368e8ff64da7b2f9cb63df67225b3
|