Skip to main content

langchain-runcrate

LangChain chat model for Runcrate: 200+ open models (DeepSeek, Qwen, Llama, Kimi, gpt-oss and more) behind one OpenAI-compatible API, billed per token from one prepaid balance. The same account rents GPUs by the hour when you want to fine-tune or serve your own model.

Install

pip install -U langchain-runcrate

Create an API key (docs) and export it:

export RUNCRATE_API_KEY="..."

Chat

from langchain_runcrate import ChatRuncrate

llm = ChatRuncrate(model="deepseek-ai/DeepSeek-V3.2", temperature=0)
print(llm.invoke("Explain LoRA fine-tuning in one sentence.").content)

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

Tool calling and structured output

from pydantic import BaseModel
from langchain_core.tools import tool


@tool
def gpu_price(gpu: str) -> str:
    """Return the hourly price of a GPU."""
    return "see https://www.runcrate.ai/api/gpu-pricing"


llm_with_tools = llm.bind_tools([gpu_price])
print(llm_with_tools.invoke("What does an H100 cost per hour?").tool_calls)


class Summary(BaseModel):
    title: str
    bullets: list[str]


print(llm.with_structured_output(Summary).invoke("Summarize what a GPU cloud is."))

Agents (LangGraph / create_agent)

from langchain.agents import create_agent

agent = create_agent(ChatRuncrate(model="Qwen/Qwen3-235B-A22B-Instruct-2507"), tools=[gpu_price])
agent.invoke({"messages": [{"role": "user", "content": "Price an H100 for 10 hours."}]})

Reasoning models

Reasoning models such as deepseek-ai/DeepSeek-R1-0528 return their reasoning in message.additional_kwargs["reasoning_content"], both in invoke and in stream.

Configuration

Argument Env var Default
api_key RUNCRATE_API_KEY required
base_url RUNCRATE_API_BASE https://api.runcrate.ai/v1
model required, any id from GET https://api.runcrate.ai/v1/models

Every other ChatOpenAI argument (temperature, max_tokens, timeout, max_retries, streaming, model_kwargs ...) works the same way.

Models and per-token prices: runcrate.ai/inference/pricing.

Let your agent rent GPUs too

Runcrate also runs a remote MCP server at https://mcp.runcrate.ai/mcp (OAuth sign-in, no key) so Claude Code, Cursor or any MCP client can launch and drive GPU instances. Setup: runcrate.ai/docs/mcp/setup, client packages: aeonmindai/runcrate-mcp.

Development

uv run --group test pytest tests/unit_tests
RUNCRATE_API_KEY=... uv run --group test pytest tests/integration_tests

License

MIT, Aeonmind LLC.

Metadata

Release files for langchain-runcrate 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-runcrate 0.1.0
File Size Uploaded Provenance Actions
langchain_runcrate-0.1.0.tar.gz 5.8 kB Without provenance Details for langchain_runcrate-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 12.0 kB

Release files / langchain_runcrate-0.1.0.tar.gz

Download URL langchain_runcrate-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c5b3a420418db965d95a783a4c95a5deeb323fc102e495597dd4456a331e5d2c
BLAKE2b-256 checksum
How to use checksums
9f9263c76bc360ce5b9ccd7fec0f3b308ebe5e272e5337cffac047ff3ca30efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

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

Download URL langchain_runcrate-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab22fb5befa796f22ab64e32559bda6d7467a8b3a1d8f0d02e70c01d7e7f7f6f
BLAKE2b-256 checksum
How to use checksums
9be3a7f49867634f950419e3715176462ead6f3eddcb73e474f5206235b5db77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for langchain-runcrate 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