Skip to content

langroid

v0.65.15 Breaking

This release includes 1 breaking change for platform teams planning a safe upgrade.

✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

agents ai chatgpt function-calling llm gpt-4
+10 more
gpt4 information-retrieval language-model llama llm-agent llm-framework local-llm multi-agent-systems openai-api retrieval-augmented-generation

Affected surfaces

auth

Summary

AI summary

Added api_key_provider to OpenAIGPTConfig for rotating bearer tokens with Vertex AI and Azure Entra ID.

Full changelog

Rotating / short-lived API keys (Vertex AI, Azure Entra ID)

OpenAIGPTConfig now supports endpoints that authenticate with short-lived,
rotating bearer tokens — e.g. Google Vertex AI (OAuth/ADC tokens, ~1h TTL) or
Azure OpenAI with Entra ID — via the new api_key_provider field: a callable
returning a currently-valid token.

import langroid.language_models as lm

config = lm.OpenAIGPTConfig(
    chat_model="google/gemini-2.5-flash",
    api_base="https://aiplatform.googleapis.com/v1beta1/projects/<proj>"
             "/locations/global/endpoints/openapi",
    api_key_provider=get_token,   # () -> str, called before every request
)
  • Resolved per request (including retries and streaming) — tokens never go
    stale, no matter how long the process runs. Works for both chat and
    achat; a blocking token refresh never stalls the event loop.
  • Client cache stays bounded: clients are cached by the provider's
    identity, never by token values — rotating tokens create no new cache
    entries, and tokens are never retained in cache keys.
  • Takes precedence over api_key / OPENAI_API_KEY; raises a clear error for
    groq/, cerebras/, and litellm-adapter models (OpenAI-client path only).
  • For transport-level control (e.g. request signing), the
    http_client_factory + httpx.Auth pattern is documented as an
    alternative, along with an Azure Entra ID recipe.

📖 Docs: Rotating / Short-Lived API Keys

Note: the openai dependency floor is now >=1.106.0 (the first version
with callable-API-key support); older SDKs would send the callable verbatim in
the auth header.

PR #1081, closes #1080.

Breaking Changes

  • Minimum `openai` dependency version raised to >=1.106.0; older versions will fail with callable API key support.

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track langroid

Get notified when new releases ship.

Sign up free

About langroid

Harness LLMs with Multi-Agent Programming

All releases →

Related context

Earlier breaking changes

  • v0.65.9 MCP tool parameters now strictly validate enums, unions, and nested models.
  • v0.65.5 Blocks code‑execution, file, and network primitives in creation tools by default.
  • v0.65.5 Restricts retrieval tools to read‑only queries; write or admin clauses are rejected by default.
  • v0.65.3 Raw user messages containing tools registered with `enable_message(..., use=False, handle=True)` are now dropped instead of executed.
  • v0.65.2 Restricts eval'd expression builtins to a curated safe set, breaking code that relied on full Python builtins (e.g., __import__, open).

Beta — feedback welcome: [email protected]