Skip to main content

A package for managing multiple LLM providers with automatic key shifting to bypass rate limits and quotas while maintaining conversation context

Project description

APIShift

Overview

APIShift is a Python package that enables seamless interaction with multiple free-tier language model (LLM) providers.

Installation

pip install APIShift

Quick Start

from APIShift import Conversation
from APIShift import GeminiProvider, OpenRouterProvider

# Initialize providers with API keys
gemini_keys = ['your_gemini_api_key1', 'your_gemini_api_key2']
openrouter_keys = ['your_openrouter_api_key1', 'your_openrouter_api_key2']

# Create a conversation with multiple providers
conversation = Conversation([
    GeminiProvider(gemini_keys),
    OpenRouterProvider(openrouter_keys)
])

# Send messages
response = conversation.send_message("Hello, how are you?")
print(response)

Using FAISS for Context Retrieval

APIShift now supports using FAISS for context retrieval. This allows you to add messages to a FAISS index and retrieve contextually relevant messages during a conversation.

Example

from APIShift import Conversation
from APIShift import GeminiProvider, OpenRouterProvider

# Initialize providers with API keys
gemini_keys = ['your_gemini_api_key1', 'your_gemini_api_key2']
openrouter_keys = ['your_openrouter_api_key1', 'your_openrouter_api_key2']

# Create a conversation with multiple providers
conversation = Conversation([
    GeminiProvider(gemini_keys),
    OpenRouterProvider(openrouter_keys)
])

# Add messages to FAISS index
conversation.add_to_faiss("Hello, how are you?")
conversation.add_to_faiss("What is the weather like today?")

# Send messages and retrieve context
response = conversation.send_message("Tell me about the weather.")
print(response)

More details coming soon...

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

apishift-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apishift-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file apishift-0.1.0.tar.gz.

File metadata

  • Download URL: apishift-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for apishift-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2aaa43dab3f1f27a0982182b2d335e241e9bbf8c0ecaa85b3c4847d0a74c7731
MD5 e02a7d65e29f5e1c518a51849bff7745
BLAKE2b-256 3908b6cd9540c22a893210930e606a3c39de5dfd597fbda71dc85f10547d0113

See more details on using hashes here.

File details

Details for the file apishift-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: apishift-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for apishift-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cf46262bb3620f8389e608f6da3b2827cb2ddf11eabcee1db1fec6ebf195b54
MD5 aaa44c7886ba2cc088d3fd62d3bc3e43
BLAKE2b-256 157cc2ee98feb5c4097ece58ed64f5d7981e8480e742282130ed14f543462602

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page