Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.1 instead.
Reason given by maintainers: Default embeddings model id was renamed on SovereignEG. Use 0.1.1 or later.

langchain-sovereigneg

LangChain and LangGraph integration for SovereignEG, the Egyptian sovereign AI platform: 230+ local and international models behind one OpenAI-compatible API, billed in Egyptian pounds.

تكامل رسمي بين LangChain و LangGraph ومنصة SovereignEG — منصة الذكاء الاصطناعي السيادية المصرية. موديلات محلية وعالمية من خلال API واحد، والدفع بالجنيه المصري.

Install

pip install -U langchain-sovereigneg
export SOVEREIGNEG_API_KEY="your-api-key"   # https://sovereigneg.com/dashboard/keys

Chat models

from langchain_sovereigneg import ChatSovereignEG

llm = ChatSovereignEG(model="gpt-oss-20b", temperature=0)
print(llm.invoke("اشرح يعني إيه LangGraph في جملتين").content)

Use any chat model ID from the SovereignEG catalog. Streaming, async, tool calling and structured output work the same as with ChatOpenAI:

for chunk in llm.stream("Write a haiku about the Nile"):
    print(chunk.text, end="")

Embeddings

from langchain_sovereigneg import SovereignEGEmbeddings

embeddings = SovereignEGEmbeddings(model="embeddinggemma-300m")
vector = embeddings.embed_query("مرحبا بالعالم")

LangGraph agent

pip install -U langchain langchain-sovereigneg
from langchain_core.tools import tool
from langchain.agents import create_agent  # runs on LangGraph
from langchain_sovereigneg import ChatSovereignEG


@tool
def egp_to_usd(amount: float, rate: float) -> float:
    """Convert Egyptian pounds to US dollars at the given rate."""
    return round(amount / rate, 2)


agent = create_agent(ChatSovereignEG(model="gpt-oss-20b"), tools=[egp_to_usd])
result = agent.invoke(
    {
        "messages": [
            {"role": "user", "content": "How much is 5000 EGP at 48.5 per dollar?"}
        ]
    }
)
print(result["messages"][-1].content)

For agents, pick a catalog model that supports function calling.

Configuration

Argument Environment variable Default
api_key SOVEREIGNEG_API_KEY none (required on the default URL)
base_url SOVEREIGNEG_API_BASE https://backend.sovereigneg.com/v1

Set base_url to point at a dedicated or private SovereignEG deployment.

Other frameworks

SovereignEG works with any OpenAI-compatible client. Guides for LlamaIndex, CrewAI, Open WebUI, OpenCode and more are at sovereigneg.com/docs/integrations.

Development

uv sync --all-groups
uv run pytest tests/unit_tests                              # offline
SOVEREIGNEG_API_KEY=... uv run pytest tests/integration_tests # live API

License

MIT

Metadata

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

Built distribution (wheel)

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

Total release size: 15.2 kB

Release files / langchain_sovereigneg-0.1.0.tar.gz

Download URL langchain_sovereigneg-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1b635017442de37a8046265ec3ef3fc3aa1491d9ce76bff9eb90f0cf613f7c32
BLAKE2b-256 checksum
How to use checksums
ff5024709e162ad0480884a5c9d87c3498233f9576872d36e32c8e4a49e47a0c
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 18, 2026.

Transparency log

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

Download URL langchain_sovereigneg-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e70a7c29a93fc2d927c73e3ecc5747e9dd187ffff933248780c1aa0a95572a39
BLAKE2b-256 checksum
How to use checksums
00b6a944503a7f63c8d388356e6361a7a72c6cd5c1b3b656d738fe7e3b6c6a45
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 18, 2026.

Transparency log

Security for langchain-sovereigneg 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_sovereigneg-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 18, 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