Skip to main content

lange-python

Python helpers for Lange services.

The package is organized into two public domains:

  • lange.mesh contains mesh workers and plugins; its wire models live in lange.mesh.contracts.
  • lange.ai contains AI inference plugins, models, and servers; its model configuration types live in lange.ai.contracts.

Mesh Relay Worker

MeshWorker connects a local HTTP service to the Lange mesh relay and forwards public relay requests to your local target.

pip install lange-python
import asyncio
import os
import time

from lange.mesh import MeshRelayPlugin, MeshWorker

relay = MeshWorker(
    project_id=os.environ["MESH_PROJECT_ID"],
    plugins=[MeshRelayPlugin("http://localhost:3000")],
)

relay.start()

try:
    while relay.remote_relay_address is None and relay.is_alive():
        time.sleep(0.25)
    print(relay.remote_relay_address)
finally:
    asyncio.run(relay.stop())

The worker connects to wss://mesh.lange-labs.com/worker/proxy by default and receives a public relay address for the project, such as https://my-project.mesh.lange-labs.com/.

If a mesh deployment requires bearer authentication, pass the token as api_key. Keep API keys in the environment or a local secret store instead of hardcoding them in application code.

import os

from lange.mesh import MeshRelayPlugin, MeshWorker

relay = MeshWorker(
    project_id=os.environ["MESH_PROJECT_ID"],
    plugins=[MeshRelayPlugin("http://localhost:3000")],
    api_key=os.environ["LANGE_LABS_API_KEY"],
)

The relay exposes lifecycle state for integrations:

  • remote_relay_address: public REST relay address returned by the mesh service

Stop the worker from an async context:

await relay.stop()

AI Inference Plugins

Install the backend required by the host platform, then attach one plugin per model. Default ports are assigned from 8500 in plugin order and can be overridden explicitly.

pip install "lange-python[ai-mlx]"
from lange.ai import MeshAiPlugin
from lange.ai.contracts import AiModelConfig
from lange.mesh import MeshWorker

model = AiModelConfig(
    model_name="example/model",
    model_alias="example",
    model_type="LLM",
    registration=None,
)
worker = MeshWorker(
    project_id="00000000-0000-0000-0000-000000000001",
    plugins=[MeshAiPlugin(model)],
)

Metadata

Release files for lange-python 0.10.0

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

Source distribution (sdist)

Source distribution for lange-python 0.10.0
File Size Uploaded Provenance Actions
lange_python-0.10.0.tar.gz 24.6 kB With provenance Details for lange_python-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lange-python 0.10.0
File Interpreter ABI Platform Actions
lange_python-0.10.0-py3-none-any.whl Python 3 none any Details for lange_python-0.10.0-py3-none-any.whl

Total release size: 64.7 kB

Release files / lange_python-0.10.0.tar.gz

Download URL lange_python-0.10.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9684380ef15983d1bec39004d167d4b45d439f8e44c0ac72b607c41d31dc2a1a
BLAKE2b-256 checksum
How to use checksums
97cf197a4ad61c9ac1063939636cf0819180f9a4263838e1726cbe3bb2a25e52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / lange_python-0.10.0-py3-none-any.whl

Download URL lange_python-0.10.0-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54070404a54a3f7ec71302069e81b02dfecabc6a3b38377f7d257ab6bb70f186
BLAKE2b-256 checksum
How to use checksums
b76585ba9aa5edf40f11b751312ee66432b8f815c938cc51f0508102a211a23a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Security for lange-python 0.10.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lange_python-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

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.10.0 This release

2 release files Full 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