llama-proxy
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.pyandcore.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
- Request: Client sends a request intended for a backend service to the proxy.
- Proxy Logic: The proxy server intercepts the request.
- 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).
- Backend Interaction: The proxy forwards the request to the selected backend.
- Response: The backend service sends the response back to the proxy.
- Proxy Handling: The proxy may cache the response before returning it to the client.
- 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.
Metadata
Release files for llama-proxy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_proxy-0.1.0.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_proxy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / llama_proxy-0.1.0.tar.gz
| Download URL | llama_proxy-0.1.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3620ee1174b789d423d4f7ddc28cf2e1e6100b08583963f0358e9dc1a898a32a
|
|
BLAKE2b-256 checksum How to use checksums |
0f3cef8310190b918af8e0d1e16868ca03e06d7267e51f89dff93fddbed4f6bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / llama_proxy-0.1.0-py3-none-any.whl
| Download URL | llama_proxy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71fe9cc4f40ecb329a792bf7910f46d0efe824c26b4a4725514755fd94f9bbce
|
|
BLAKE2b-256 checksum How to use checksums |
ff3f0f268c595ac8cae9d54858c9cbab6729559ec7480f2a53e2d6b97ecb8d98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|