Skip to main content

A comprehensive multi-provider LLM proxy library with unified interface

Project description

ScaleXI LLM

A production-ready, multi-provider LLM proxy that gives you one unified API for many different model providers.

  • 9 Providers: OpenAI, Anthropic (Claude), Google (Gemini), Groq, DeepSeek, Alibaba/Qwen, Grok, local Ollama, and RunPod (native API)
  • 60+ Model Configurations: Pricing, limits, and capabilities encoded in a single model registry
  • Structured Outputs: Pydantic schemas with intelligent fallbacks and validation
  • Vision & Files: Image analysis, PDF/DOCX/TXT/JSON handling, and automatic vision fallbacks
  • Web Search: Exa + SERP (Google) integration for retrieval-augmented generation (optionally restricted to a single domain)
  • Fallbacks & Reliability: Provider-best and global-standard fallbacks, plus detailed error logging
  • LangSmith Tracing: Optional built-in observability — set enable_tracing=True and every call is traced

This package is ideal when you want a single, consistent interface to multiple LLM vendors, with:

  • Centralized configuration for models and costs
  • Unified ask function (ask_llm) that works across providers
  • Built-in support for web search, files, and images
  • Optional local-only workflows via Ollama
  • Optional LangSmith tracing with token/cost tracking

Installation

pip install scalexi_llm

Quick Example

from scalexi_llm import LLMProxy

llm = LLMProxy()

response, execution_time, token_usage, cost = llm.ask_llm(
    model_name="chatgpt-4o-latest",
    system_prompt="You are a helpful assistant.",
    user_prompt="Explain quantum computing in simple terms."
)

print(response)

Model Listing

Inspect all registered models and their metadata (provider, pricing, limits, capabilities):

import json
from scalexi_llm import LLMProxy

llm = LLMProxy(verbose=0)
models = llm.list_available_models()
print(json.dumps(models, indent=2))

Domain-Restricted Web Search

from scalexi_llm import LLMProxy

llm = LLMProxy()

response, _, _, _ = llm.ask_llm(
    model_name="gpt-5-mini",
    user_prompt="Find the admissions requirements",
    websearch=True,
    search_tool="both",
    search_domain="binbaz.org.sa"
)

LangSmith Tracing (Optional)

from scalexi_llm import LLMProxy

# pip install langsmith  (+ set LANGSMITH_API_KEY in .env)
llm = LLMProxy(enable_tracing=True)

response, exec_time, token_usage, cost = llm.ask_llm(
    model_name="chatgpt-4o-latest",
    user_prompt="What is quantum computing?"
)
# Token usage, cost, provider, and model are automatically logged to LangSmith

Features at a Glance

  • One LLMProxy class for all providers
  • Unified ask_llm API for text, files, images, and web search (with file/image fallbacks for providers like RunPod/Ollama)
  • Pydantic-based structured outputs with retry and model fallbacks
  • Vision fallback when a chosen model doesn't support images
  • Token and cost accounting for every call
  • Optional LangSmith tracing with zero-code setup (enable_tracing=True)
  • Comprehensive test suite (provider_test.py, ollama_test.py, combined_test.py)

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

scalexi_llm-0.1.38.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

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

scalexi_llm-0.1.38-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file scalexi_llm-0.1.38.tar.gz.

File metadata

  • Download URL: scalexi_llm-0.1.38.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for scalexi_llm-0.1.38.tar.gz
Algorithm Hash digest
SHA256 00646f04d92796e0c36f5e7c4cf0359b97aa3d53800a763c690c89ed055dcc67
MD5 f8a7ada87582b34e989d16d03fb16e22
BLAKE2b-256 a5bba892c2d7238a716228a94bd63034fbd62a90ed658b8f874b89721e5a98a2

See more details on using hashes here.

File details

Details for the file scalexi_llm-0.1.38-py3-none-any.whl.

File metadata

  • Download URL: scalexi_llm-0.1.38-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for scalexi_llm-0.1.38-py3-none-any.whl
Algorithm Hash digest
SHA256 1294e169b88d277dbd68be766f28923723946d66a93d12c0122d397b8d91b356
MD5 a9bdde7826ade262961f6d3123ab2724
BLAKE2b-256 8f7f9ddb9cb2317df11abf5bf2b7ee21cc423614b6d826b830c20c0ef9a55aba

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