Skip to main content

langchain-xynq

LangChain / LangGraph integration for XYNQ — decentralized, OpenAI-compatible inference.

pip install langchain-xynq

Quick start

import os

os.environ["XYNQ_API_KEY"] = "xynq_sk_..."  # or export in your shell

from langchain_xynq import ChatXYNQ

llm = ChatXYNQ.smart(temperature=0.7)
print(llm.invoke("Explain backpropagation in two sentences.").content)

Get a key at xynq.ai → Account (1M free tokens/month).

API

ChatXYNQ

Drop-in ChatOpenAI subclass with XYNQ defaults:

Default Value Override
Base URL https://xynq.ai/v1 XYNQ_BASE_URL or base_url=
API key XYNQ_API_KEY api_key=
Model xynq-1 model=
from langchain_xynq import ChatXYNQ, FAST_MODEL, SMART_MODEL

fast = ChatXYNQ.fast()           # xynq-1
smart = ChatXYNQ.smart()         # xynq-glm-5.2
custom = ChatXYNQ(model="xynq-qwen-3.5-27b", temperature=0)

Streaming works like any LangChain model:

for chunk in ChatXYNQ.smart().stream("Count to five."):
    print(chunk.content or "", end="", flush=True)

LangGraph

Use ChatXYNQ anywhere you would use ChatOpenAI:

from langgraph.prebuilt import create_react_agent
from langchain_xynq import ChatXYNQ

agent = create_react_agent(ChatXYNQ.smart(), tools=[...])
agent.invoke({"messages": [("user", "Hello")]})

Runnable examples: examples/langgraph-xynq/

Models

Alias Model id
ChatXYNQ.fast() xynq-1
ChatXYNQ.smart() xynq-glm-5.2
— xynq-qwen-3.5-27b
— xynq-supergemma-4-26b

Node / TypeScript

Use @xynqai/langchain for the JavaScript equivalent.

License

MIT

Metadata

Release files for langchain-xynq 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-xynq 0.1.0
File Size Uploaded
langchain_xynq-0.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

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

Total release size: 7.2 kB

Release files / langchain_xynq-0.1.0.tar.gz

Download URL langchain_xynq-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
759aff0e343861711e73951e4edb99f93b7977fa2556a7dfb7a37acdf2e7af3b
BLAKE2b-256 checksum
How to use checksums
c38192379fc3d078ec4c9001d234448eb7a3cfeb6fdf7c1d0883a112d3595301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

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

Download URL langchain_xynq-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
671316db6ce0222a9848cd8e2d2bf6212ee19b65c12774ba2b7b6d196a02c3b5
BLAKE2b-256 checksum
How to use checksums
3afd1773458d6fd5d49b1673a27e7d4055b97795959abefde5ef8a598d4b7935
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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