Skip to main content

langchain-turing

LangChain chat model for Turing Engine: ChatTuring talks to a turing serve server over its OpenAI-compatible /v1/chat/completions endpoint. It depends only on langchain-core and httpx, not on Turing Engine itself.

pip install langchain-turing   # not on PyPI yet: pip install ./packages/langchain-turing from a clone of intutic/turing
turing serve --model Qwen/Qwen2.5-1.5B-Instruct --port 8000   # on the machine with the GPU
from langchain_turing import ChatTuring

llm = ChatTuring(model="Qwen/Qwen2.5-1.5B-Instruct", base_url="http://localhost:8000/v1", max_tokens=64)

print(llm.invoke("Explain KV cache paging in one sentence:").content)

for chunk in llm.stream("Write a haiku about GPUs:"):
    print(chunk.content, end="", flush=True)

base_url and api_key default to $TURING_BASE_URL and $TURING_API_KEY (the key is checked only when the server runs with --api-key). invoke, stream, batch, their async forms and LangGraph work as with any LangChain chat model.

Tool calling

bind_tools sends the tools with each request; calls the model makes come back on AIMessage.tool_calls.

from langchain_core.tools import tool

@tool
def get_weather(city: str) -> str:
    """Current weather for a city."""
    return "sunny"

msg = llm.bind_tools([get_weather]).invoke("What's the weather in Paris?")
print(msg.tool_calls)

Whether the model emits a tool call depends on the model; small models often answer in text. Pruning, KV cache format and quantization are chosen when the server starts, not per request.

Tests

pip install -e ".[test]"
pytest tests/unit_tests
TURING_BASE_URL=http://localhost:8000/v1 TURING_MODEL=Qwen/Qwen2.5-1.5B-Instruct pytest tests/integration_tests

The integration tests run LangChain's standard chat-model suite against a live server.

License: Apache-2.0 (Turing Engine itself is BSL 1.1).

Metadata

Release files for langchain-turing 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-turing 0.1.0
File Size Uploaded Provenance Actions
langchain_turing-0.1.0.tar.gz 9.1 kB With provenance Details for langchain_turing-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.9 kB

Release files / langchain_turing-0.1.0.tar.gz

Download URL langchain_turing-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
75d851b24484831bcd427e9633bf03816bfc94fb8001fe055595780fefc8246b
BLAKE2b-256 checksum
How to use checksums
7c1ea856203375b29e2883b20e443e3c9272f9555c9131c8abca9e912851a9ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

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

Download URL langchain_turing-0.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab320af37fbb97b9ed1b17b538343fe4c261a14f573caf814f5091335bbfcd23
BLAKE2b-256 checksum
How to use checksums
e60ce96c4b752259a4eb43a48bc3f014d615d8cda7bc67c7d4ed046dfff8b5cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

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

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_turing-0.1.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 Nov 20, 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.1.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