Skip to main content

ScaleXI LLM

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

  • 10 Providers: OpenAI, Anthropic (Claude), Google (Gemini), Groq, DeepSeek, Alibaba (Qwen), Grok (xAI), Moonshot (Kimi), local Ollama, and RunPod (native API)
  • 59 Built-in Model Configurations: GPT-5.x, Claude Opus/Sonnet/Haiku 4.x, Gemini 3.x/2.5, DeepSeek V4, Kimi K3, Qwen, Grok and more, with pricing, limits and capabilities in one registry
  • Structured Outputs: Pydantic schemas with validation and optional model fallbacks
  • Streaming: stream=True yields chunks with final token usage and cost
  • Vision & Files: Single/multi-image input, PDF/DOCX/TXT/JSON handling, and automatic vision fallbacks
  • Web Search: Exa and/or SerpAPI for retrieval-augmented answers (optionally restricted to one domain)
  • Cost Tracking: Token usage and USD cost for every call
  • LangSmith Tracing: Optional — set enable_tracing=True and every call is traced

Installation

pip install scalexi_llm

Set the API keys for the providers you use (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, MOONSHOT_API_KEY) in your environment or a .env file.

Quick Example

from scalexi_llm import LLMProxy

llm = LLMProxy()

response, execution_time, token_usage, cost = llm.ask_llm(
    model_name="gpt-5.6-terra",
    system_prompt="You are a helpful assistant.",
    user_prompt="Explain quantum computing in simple terms."
)

print(response, cost)

Structured Output

from pydantic import BaseModel

class Answer(BaseModel):
    summary: str
    key_points: list[str]

response, _, _, _ = llm.ask_llm(
    model_name="claude-sonnet-4-6",
    user_prompt="Summarize the benefits of solar energy.",
    schema=Answer
)
answer = Answer.model_validate_json(response)

Streaming

for chunk in llm.ask_llm(model_name="gemini-flash-latest", user_prompt="Tell me a story", stream=True):
    print(chunk.delta, end="", flush=True)
    if chunk.done:
        print("\n", chunk.token_usage, chunk.cost)

Model Listing

import json
llm = LLMProxy(verbose=0)
print(json.dumps(llm.list_available_models(), indent=2))
response, _, _, _ = llm.ask_llm(
    model_name="gpt-5.6-terra",
    user_prompt="Find the admissions requirements",
    websearch=True,
    search_tool="both",
    search_domain="binbaz.org.sa"
)

LangSmith Tracing (Optional)

# 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="gpt-5.6-terra",
    user_prompt="What is quantum computing?"
)
# Token usage, cost, provider, and model are logged to LangSmith

Features at a Glance

  • One LLMProxy class and one ask_llm function for all providers
  • Text, files, images, web search and streaming through the same call
  • Local models via ollama/<model> and custom endpoints via runpod/<provider>/<model>
  • Pydantic-based structured outputs with retries and opt-in model fallbacks
  • Vision fallback when the chosen model doesn't support images
  • Token and cost accounting for every call, including search and fallback steps

Metadata

Release files for scalexi-llm 0.1.51

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scalexi-llm 0.1.51
File Size Uploaded Provenance Actions
scalexi_llm-0.1.51.tar.gz 36.2 kB Without provenance Details for scalexi_llm-0.1.51.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scalexi-llm 0.1.51
File Interpreter ABI Platform Actions
scalexi_llm-0.1.51-py3-none-any.whl Python 3 none any Details for scalexi_llm-0.1.51-py3-none-any.whl

Total release size: 65.7 kB

Release files / scalexi_llm-0.1.51.tar.gz

Download URL scalexi_llm-0.1.51.tar.gz
Size 36.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3f98208fcc02ba1b6a8e33572c176b35a959a6546c6842efd7a1fe8189db53c3
BLAKE2b-256 checksum
How to use checksums
a54cfbca6a1c0c36090bc10d7df9dcd44acb9746f37ef9a14151b5f7862111a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / scalexi_llm-0.1.51-py3-none-any.whl

Download URL scalexi_llm-0.1.51-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f075d9bfaa60293b750a5390a274e029b351d1600a8897db33ce71a44db8cf2
BLAKE2b-256 checksum
How to use checksums
0410bc16e1a6515b6281154a42142adcb32581bc24f513e87b6583b9affa1269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for scalexi-llm 0.1.51

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.51 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page