Skip to main content

langchain-obscurify

LangChain chat model for Obscurify.ai, a private AI chat service with an OpenAI-compatible API (200+ models).

ChatObscurify supports invoke, streaming, async, tool calling, structured output and reasoning effort.

Install

pip install -U langchain-obscurify

Get an API key

  1. Create an account at obscurify.ai. An account is a random account number: no email, username or phone.
  2. Add a balance. The API works on every plan with a positive balance. New accounts get $1 of starter credit (limits apply; see https://obscurify.ai/pricing).
  3. Open https://obscurify.ai/account and click Show API Key. Keys look like sk-obs1_....
export OBSCURIFY_API_KEY="sk-obs1_..."

Usage

from langchain_obscurify import ChatObscurify

model = ChatObscurify(model="deepseek/deepseek-v4-flash", temperature=0)

print(model.invoke("Write a haiku about privacy.").content)

for chunk in model.stream("Count to five."):
    print(chunk.text, end="", flush=True)

Tool calling

from langchain_core.tools import tool


@tool
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"It is sunny in {city}."


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

Structured output

from pydantic import BaseModel


class Joke(BaseModel):
    setup: str
    punchline: str


print(model.with_structured_output(Joke).invoke("Tell me a joke about cats"))

Reasoning

model = ChatObscurify(model="z-ai/glm-5.3-flash", reasoning_effort="low")
msg = model.invoke("Is 221 prime?")
print(msg.additional_kwargs.get("reasoning_content"))
print(msg.content)

Agents

from langchain.agents import create_agent

agent = create_agent(ChatObscurify(model="deepseek/deepseek-v4-flash"), tools=[get_weather])
agent.invoke({"messages": [{"role": "user", "content": "Weather in Oslo?"}]})

Models

Any model ID from GET https://obscurify.ai/v1/models works, for example deepseek/deepseek-v4-flash, meta-llama/llama-3.3-70b-instruct, z-ai/glm-5.3-flash or qwen/qwen3.8-27b. Frontier models need the Casual plan; uncensored models need Pro. Prices per model: https://obscurify.ai/model_cards.

Configuration

Argument Env var Default
api_key OBSCURIFY_API_KEY none (required)
base_url OBSCURIFY_API_BASE https://obscurify.ai/v1

All other ChatOpenAI arguments (temperature, max_tokens, timeout, max_retries, reasoning_effort, model_kwargs, ...) work the same way.

Privacy

Obscurify.ai doesn't store prompts or responses, scrambles identities before requests reach model providers, and sends text requests only over zero-data-retention routes. Details: https://obscurify.ai/privacy.

MIT licensed.

Metadata

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

Built distribution (wheel)

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

Total release size: 15.2 kB

Release files / langchain_obscurify-0.1.0.tar.gz

Download URL langchain_obscurify-0.1.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fab582c79f7315311182ab745ab53ea690cc5bdeeb1b32e8fc859a22de27e364
BLAKE2b-256 checksum
How to use checksums
45277c4d2274df858d56d1a33e15913fee4b3241ad1b664cc64eb803cad8d9ac
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 Oct 28, 2026.

Transparency log

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

Download URL langchain_obscurify-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2badd600fc71ee309d347af0aeb498e0720ecc27c39ee171b8f8ff4df5d18e4
BLAKE2b-256 checksum
How to use checksums
8a1045f422faab09c511d156933f88237102d3485a46aa9b4c037695d7490738
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 Oct 28, 2026.

Transparency log

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

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

Select from 2 files

Attestation for langchain_obscurify-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 Oct 28, 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