Skip to main content

Proxy service for the LlamaAI ecosystem.

Project description

llama-proxy

PyPI version License Python Version CI Status

Llama Proxy (llama-proxy) acts as an intelligent proxy server within the LlamaSearch AI ecosystem. It likely handles routing requests to appropriate backend services, potentially adding features like load balancing, caching, rate limiting, or authentication.

Key Features

  • Request Routing: Directs incoming requests to the correct backend service based on rules.
  • Load Balancing: May distribute traffic across multiple instances of a service.
  • Caching: Potential for caching responses to improve performance.
  • Rate Limiting: Can enforce usage limits on APIs or services.
  • Authentication/Authorization: May handle verifying credentials or permissions.
  • Core Proxy Logic: Main implementation likely resides in main.py and core.py.
  • Configurable: Routing rules, backend targets, security settings are configurable (config.py).

Installation

pip install llama-proxy
# Or install directly from GitHub for the latest version:
# pip install git+https://github.com/llamasearchai/llama-proxy.git

Usage

(Instructions on how to configure and run the proxy server will be added here.)

# Example command to run the proxy
llama-proxy start --config proxy-config.yaml

Architecture Overview

graph TD
    A[Client Application] --> B{Llama Proxy (main.py, core.py)};
    B -- Routes Request based on Config --> C[Backend Service 1];
    B -- Routes Request based on Config --> D[Backend Service 2];
    B -- Routes Request based on Config --> E[...];
    C -- Response --> B;
    D -- Response --> B;
    E -- Response --> B;
    B -- Returns Response --> A;

    subgraph Potential Proxy Features
        direction RL
        F[Load Balancing]
        G[Caching]
        H[Rate Limiting]
        I[AuthN/AuthZ]
    end

    B -- May Use --> F;
    B -- May Use --> G;
    B -- May Use --> H;
    B -- May Use --> I;

    J[Configuration (config.py)] -- Defines Rules & Backends --> B;

    style B fill:#f9f,stroke:#333,stroke-width:2px
    style C fill:#ccf,stroke:#333,stroke-width:1px
    style D fill:#ccf,stroke:#333,stroke-width:1px
    style E fill:#ccf,stroke:#333,stroke-width:1px
  1. Request: Client sends a request intended for a backend service to the proxy.
  2. Proxy Logic: The proxy server intercepts the request.
  3. Routing/Features: Based on configuration, it applies features (auth, rate limit, cache check) and routes the request to the appropriate backend service (potentially load balancing).
  4. Backend Interaction: The proxy forwards the request to the selected backend.
  5. Response: The backend service sends the response back to the proxy.
  6. Proxy Handling: The proxy may cache the response before returning it to the client.
  7. Configuration: Defines routing rules, backend addresses, caching policies, rate limits, etc.

Configuration

(Details on configuring routing rules, backend service addresses, load balancing strategies, caching options, rate limits, authentication methods, etc., will be added here.)

Development

Setup

# Clone the repository
git clone https://github.com/llamasearchai/llama-proxy.git
cd llama-proxy

# Install in editable mode with development dependencies
pip install -e ".[dev]"

Testing

pytest tests/

Contributing

Contributions are welcome! Please refer to CONTRIBUTING.md and submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

llama_proxy-0.1.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

llama_proxy-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llama_proxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3620ee1174b789d423d4f7ddc28cf2e1e6100b08583963f0358e9dc1a898a32a
MD5 e5c1ec8709945a93718a353e06d7e84e
BLAKE2b-256 0f3cef8310190b918af8e0d1e16868ca03e06d7267e51f89dff93fddbed4f6bc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for llama_proxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71fe9cc4f40ecb329a792bf7910f46d0efe824c26b4a4725514755fd94f9bbce
MD5 2a453e75eb482ebef690b0b6584f1f87
BLAKE2b-256 ff3f0f268c595ac8cae9d54858c9cbab6729559ec7480f2a53e2d6b97ecb8d98

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