Skip to main content

langchain-linkrra

LangChain chat model for Linkrra Synap — an OpenAI-compatible inference API for open models (Qwen, gpt-oss, Gemma, GLM, DeepSeek and more), billed per token.

Not to be confused with other products named "Synap". This package talks to https://synap402.com/v1, operated by Linkrra.

Install

pip install -U langchain-linkrra
export LINKRRA_API_KEY="your-api-key"   # get one at https://synap402.com

Use

from langchain_linkrra import ChatLinkrra

model = ChatLinkrra(model="gpt-oss-20b", temperature=0)
print(model.invoke("Write a haiku about open models.").content)

model="synap-v1" (the default) lets Synap pick the cheapest model that can do the job. The live model list, with context lengths and per-token prices, is always at https://synap402.com/v1/models — prices are not hard-coded here.

ChatLinkrra subclasses LangChain's BaseChatOpenAI, so streaming, async, bind_tools(...) and with_structured_output(...) work as with ChatOpenAI.

from pydantic import BaseModel

class City(BaseModel):
    name: str
    country: str

structured = ChatLinkrra(model="qwen3-coder-30b").with_structured_output(City)
structured.invoke("Which city is the Eiffel Tower in?")

Configuration

Argument Env var Default
api_key LINKRRA_API_KEY — (required)
base_url LINKRRA_API_BASE https://synap402.com/v1
model — synap-v1

Tests

pip install -e ".[test]"
pytest tests/unit_tests                 # offline
LINKRRA_API_KEY=... pytest tests/integration_tests   # one real call

License

Apache-2.0

Metadata

Release files for langchain-linkrra 0.1.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 langchain-linkrra 0.1.0
File Size Uploaded Provenance Actions
langchain_linkrra-0.1.0.tar.gz 8.3 kB Without provenance Details for langchain_linkrra-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-linkrra 0.1.0
File Interpreter ABI Platform Actions
langchain_linkrra-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_linkrra-0.1.0-py3-none-any.whl

Total release size: 16.6 kB

Release files / langchain_linkrra-0.1.0.tar.gz

Download URL langchain_linkrra-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
29cbd9c27af57933555fd1091bc9b472b4b3daac17b58fe7ce67c8a926b64647
BLAKE2b-256 checksum
How to use checksums
4c329d52157c9e27de01ff529b32e06d183633638cc46d00bb45382d055f1c77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / langchain_linkrra-0.1.0-py3-none-any.whl

Download URL langchain_linkrra-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fde566b57d1ddebc2b3f2e15a1d9927e009f955432ead0c3ac95a36c2c6a713
BLAKE2b-256 checksum
How to use checksums
fc5b583b8b0b86dcc6b2a0b0ff3b9d48750a981c41b9546f81b1a6323b7ca234
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for langchain-linkrra 0.1.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.

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.0 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