Supported Frameworks¶
Coalex auto-instruments 15 LLM frameworks through OpenInference instrumentors. When you call coalex.auto_instrument(), the SDK automatically patches every installed framework to emit OpenInference spans.
Framework Table¶
| Framework | Python Install Extra | TypeScript npm Package | Description |
|---|---|---|---|
| OpenAI | coalex[openai] |
@arizeai/openinference-instrumentation-openai |
OpenAI SDK (GPT-4, GPT-4o, o1, etc.) |
| LlamaIndex | coalex[llamaindex] |
-- | LlamaIndex RAG framework |
| LangChain | coalex[langchain] |
@arizeai/openinference-instrumentation-langchain |
LangChain and LCEL chains |
| Google Generative AI | coalex[google-genai] |
-- | Google Generative AI (Gemini) |
| Vertex AI | coalex[vertexai] |
-- | Google Vertex AI (Gemini via GCP) |
| AWS Bedrock | coalex[bedrock] |
-- | AWS Bedrock (Claude, Titan, etc.) |
| Anthropic | coalex[anthropic] |
@arizeai/openinference-instrumentation-anthropic |
Anthropic Claude SDK |
| MistralAI | coalex[mistralai] |
-- | MistralAI SDK |
| Groq | coalex[groq] |
-- | Groq inference API |
| liteLLM | coalex[litellm] |
-- | liteLLM unified LLM gateway |
| DSPy | coalex[dspy] |
-- | DSPy programming framework |
| CrewAI | coalex[crewai] |
-- | CrewAI multi-agent framework |
| Haystack | coalex[haystack] |
-- | Haystack NLP framework |
| Instructor | coalex[instructor] |
-- | Instructor structured output |
| Guardrails | coalex[guardrails] |
-- | Guardrails AI validation |
TypeScript framework support
The TypeScript SDK currently supports auto-instrumentation for OpenAI, LangChain, and Anthropic via their respective @arizeai/openinference-instrumentation-* npm packages. Additional framework support will be added in future releases.
LangChain.js versions¶
autoInstrument(), autoInstrumentAsync() and instrumentLangChain() capture LangChain.js through @arizeai/openinference-instrumentation-langchain 4.x. Each line in the table is proven by a fixture in the repository (packages/sdk-typescript/fixtures/langchain-0.3 and langchain-1): an agent that makes a model call, runs an LCEL chain (prompt, model, parser) and calls a tool, with the exported OpenInference spans asserted on every CI run.
@langchain/core |
CommonJS app | ESM app ("type": "module") |
|---|---|---|
| 1.x (proven on 1.2.14) | Supported: LLM, CHAIN, PROMPT and TOOL spans, with model name, token counts, input and output |
Supported, with the same spans |
| 0.3 (proven on 0.3.80) | Supported, with the same spans | Supported, with the same spans |
| 0.2 and older | Not tested | Not tested |
0.3 stays supported alongside 1.x. Dropping it is a decision recorded on this page, not a side effect of an upgrade. The ESM column needs @coalex-ai/sdk 2.6.2 or later.
What the proof depends on:
- Give the spans a provider.
register()registers one globally, which is where LangChain spans go; atracerProviderpassed toautoInstrument()orinstrumentLangChain()receives them instead. - Instrument before LangChain loads. Call
autoInstrument()before the app first imports@langchain/core:
import { autoInstrument, register } from "@coalex-ai/sdk";
register({ endpoint: "...", apiKey: "...", serviceName: "my-agent" });
autoInstrument(); // { langchain: "success", ... }
// Import and run your LangChain code after this point.
ESM apps. The instrumentor hooks require() of @langchain/core's CommonJS build only. The SDK also loads LangChain's ES module build, from where the app resolves it, and hands it to the instrumentor, so an ES module that imports LangChain gets the same spans with no step of its own. autoInstrument() loads that build with require(), which needs Node 20.19 or 22.12; on an older Node an ESM app calls await autoInstrumentAsync().
A tool the agent runs produces a TOOL span carrying tool.name. The LLM span that asked for it carries no llm.output_messages.*.tool_calls attribute when the model reports the call only in LangChain's standard tool_calls field: the instrumentor reads tool calls from additional_kwargs.
Installation¶
Install all frameworks at once¶
This installs all 15 OpenInference instrumentor packages. Only frameworks that are actually installed in your environment will be instrumented -- missing frameworks are silently skipped.
Install specific frameworks¶
# Just OpenAI and LangChain
pip install "coalex[openai,langchain]"
# Just Vertex AI
pip install "coalex[vertexai]"
Install with uv¶
Install supported frameworks¶
# OpenAI
npm install @coalex-ai/sdk @arizeai/openinference-instrumentation-openai
# LangChain
npm install @coalex-ai/sdk @arizeai/openinference-instrumentation-langchain
# Anthropic
npm install @coalex-ai/sdk @arizeai/openinference-instrumentation-anthropic
# Multiple frameworks
npm install @coalex-ai/sdk \
@arizeai/openinference-instrumentation-openai \
@arizeai/openinference-instrumentation-langchain \
@arizeai/openinference-instrumentation-anthropic
Only installed instrumentor packages will be detected by autoInstrument(). Missing packages are silently skipped.
Usage¶
Auto-instrument all installed frameworks¶
Instrument specific frameworks¶
Convenience functions for individual frameworks¶
import coalex
coalex.register(endpoint="...", api_key="...", service_name="my-agent")
# Instrument individual frameworks
coalex.instrument_openai()
coalex.instrument_langchain()
coalex.instrument_llamaindex()
coalex.instrument_google_genai()
coalex.instrument_vertexai()
coalex.instrument_bedrock()
coalex.instrument_anthropic()
Return Values¶
auto_instrument() returns a dictionary mapping each framework to its instrumentation status:
| Status | Meaning |
|---|---|
"success" |
Framework was found and instrumented |
"not_installed" |
OpenInference package not installed -- skipped |
"already_instrumented" |
Framework was already instrumented (e.g., by a previous call) |
"excluded" |
Framework was in the exclude_libraries list |
"error" |
Instrumentation failed (logged as warning, not raised) |
OpenInference Compatibility¶
Coalex uses OpenInference semantic conventions for all auto-instrumented spans. This means:
- Spans are categorized by kind:
LLM,RETRIEVER,EMBEDDING,RERANKER,TOOL,GUARDRAIL - Standard attributes are set:
llm.model_name,llm.token_count.prompt,llm.token_count.completion,input.value,output.value - Any OpenInference-compatible instrumentor will work with Coalex
Manual spans
For operations not covered by auto-instrumentation, use extension decorators like @retrieval_span, @tool_span, @embedding_span, @reranker_span, and @guardrail_span. These also emit OpenInference-compatible spans.
Troubleshooting¶
No frameworks instrumented:
If auto_instrument() reports no libraries were instrumented, install the instrumentor packages:
Framework not captured:
Ensure the framework's OpenInference package is installed. Check the return value of auto_instrument() for the specific status.
Duplicate instrumentation warnings:
If you call auto_instrument() multiple times, already-instrumented frameworks will return "already_instrumented" and will not be patched again. This is safe and expected.