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
- Create an account at obscurify.ai. An account is a random account number: no email, username or phone.
- 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).
- 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.
Links
- API docs: https://obscurify.ai/api-docs
- Source: https://github.com/Obscurify-ai/langchain-obscurify
- JavaScript package:
@obscurify/langchain - Contact: https://obscurify.ai/contact
MIT licensed.
Metadata
Release files for langchain-obscurify 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_obscurify-0.1.1.tar.gz | 7.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_obscurify-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.1 kB
Release files / langchain_obscurify-0.1.1.tar.gz
| Download URL | langchain_obscurify-0.1.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fcb6a349150e3cf744069f81591ba00fc7de6ccebdbd11e211cb4055d45d4b1
|
|
BLAKE2b-256 checksum How to use checksums |
a650c14db8d5897e3919e5dcd23c42c5bfc7e2979e84555c8e23d5b9b84d045e
|
| 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 logRelease files / langchain_obscurify-0.1.1-py3-none-any.whl
| Download URL | langchain_obscurify-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70043dbb583514f309473340549b6b63d2ef8a30587b60d26ab346672dfafe94
|
|
BLAKE2b-256 checksum How to use checksums |
4ed6dd999ac415d6319d26ddfbd3ba73de97f86de396322f69f8352bdcbb55fd
|
| 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 logSecurity for langchain-obscurify 0.1.1
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.
Attestation for langchain_obscurify-0.1.1.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 logA 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.