Skip to main content

High-performance prompt compression and LLM proxy SDK by IntelliDeep

Project description

nlproxy-python: High-Performance Python SDK (v1.0.0)

This branch contains the high-performance Python SDK bindings for nlproxy, compiled from our Rust core engine using Maturin and PyO3.

It provides the speed of native Rust execution (sub-3ms latency, 5000+ rps) wrapped in an easy-to-use Python interface.

License: BSL-1.1


📦 Installation

To install this high-performance version of the SDK directly from GitHub:

# Install directly from the sdk-python branch
pip install git+https://github.com/intellideep/nlproxy.git@sdk-python

Note: This will automatically build and compile the Rust core on your local system. Ensure you have the Rust toolchain (rustc and cargo) installed.


💻 Code Example

from nlproxy import init_engine, ensure_models_ready, compress_prompt, run_unified_pipeline, CompressRequest, CompressUnifiedRequest

# 1. Download models automatically if needed
ensure_models_ready("models")

# 2. Initialize the Candle embedding engine with local models
init_engine(
    "models/all-MiniLM-L6-v2/model.safetensors",
    "models/all-MiniLM-L6-v2/config.json",
    "models/all-MiniLM-L6-v2/tokenizer.json"
)

# 3. Compress prompt and redact PII
req = CompressRequest(
    text="The database server is located at 192.168.1.150.",
    mode="general",
    aggressiveness=0.5
)
res = compress_prompt(req)

print("Shielded Prompt:", res.processed_text)
# "The database server is located at __PROT_82736284__."

print("PII Placeholders:", res.placeholders)
# { "__PROT_82736284__": "192.168.1.150" }

Run Unified Orchestrated Pipeline

Execute a complete secure LLM pipeline including firewall checks, Redis semantic cache lookup, prompt compression, upstream LLM execution, and post-LLM verification:

# Create pipeline request
pipeline_req = CompressUnifiedRequest(
    prompt="Connect to database and extract tables",
    domain="general",
    aggressiveness=0.0,
    provider="gemini",
    model="gemini-1.5-pro",
    bypass_cache=False,
    check_firewall=True
)

# Run pipeline
pipeline_res = run_unified_pipeline(pipeline_req)

print("Allowed:", pipeline_res.allowed)
print("Response:", pipeline_res.final_response)
print("Latency:", pipeline_res.latency_ms, "ms")

🏢 Authors & Cofounders

This SDK is developed and maintained exclusively by IntelliDeep Labs.

For attributions and licenses of integrated open-source components, see credits.md.


© 2026 IntelliDeep Labs. All rights reserved.

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

nlproxy-1.2.1.tar.gz (72.1 kB view details)

Uploaded Source

Built Distribution

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

nlproxy-1.2.1-cp38-abi3-manylinux_2_39_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.39+ x86-64

File details

Details for the file nlproxy-1.2.1.tar.gz.

File metadata

  • Download URL: nlproxy-1.2.1.tar.gz
  • Upload date:
  • Size: 72.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for nlproxy-1.2.1.tar.gz
Algorithm Hash digest
SHA256 287128c8ca54e98898e60a0c9b93dcc1ae76b53189649f17cb540629c1343e0c
MD5 4b315831d9bd9b0b2e92e18552d00918
BLAKE2b-256 a9d26e15f3558f21f4550934c4a0d11735386bbd3191ffcaf708f8a32f49d66e

See more details on using hashes here.

File details

Details for the file nlproxy-1.2.1-cp38-abi3-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for nlproxy-1.2.1-cp38-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5ffffa724b78471da20f907cb7cba86beae33f053bc2299119840562bb8270d1
MD5 d5fec06f13f80bd0ed03cbcfd7174445
BLAKE2b-256 4a2a7c757d8527c9ca949b76faa36d90b12b8e7e7d403d2dce3e78a9c4982942

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