Skip to main content
npm i @bryel/semconv
OpenInference-conformant semantic-convention constants with no @arizeai dependency. Install directly only if you write a custom SpanMapper.
import {
  SemanticConventions,    // OpenInference attribute keys (LLM_MODEL_NAME, INPUT_VALUE, …)
  OpenInferenceSpanKind,  // LLM | TOOL | CHAIN | AGENT | …
  BryelConventions,       // bryel extensions (INTERACTION_ID, COST_USD, REASONING, …)
  MimeType,               // JSON | TEXT
} from "@bryel/semconv";
Each export is a frozen object of string constants (plus matching TypeScript types). Use them as attribute keys when building a mapper.

SemanticConventions

OpenInference attribute keys. The full set, pinned to the OpenInference spec:
ConstantValue
OPENINFERENCE_SPAN_KINDopeninference.span.kind
LLM_MODEL_NAMEllm.model_name
LLM_PROVIDERllm.provider
LLM_SYSTEMllm.system
LLM_INVOCATION_PARAMETERSllm.invocation_parameters
LLM_TOKEN_COUNT_PROMPTllm.token_count.prompt
LLM_TOKEN_COUNT_COMPLETIONllm.token_count.completion
LLM_TOKEN_COUNT_TOTALllm.token_count.total
LLM_INPUT_MESSAGES · LLM_OUTPUT_MESSAGESllm.input_messages · llm.output_messages
MESSAGE_ROLE · MESSAGE_CONTENTmessage.role · message.content
INPUT_VALUE · INPUT_MIME_TYPEinput.value · input.mime_type
OUTPUT_VALUE · OUTPUT_MIME_TYPEoutput.value · output.mime_type
TOOL_NAME · TOOL_DESCRIPTION · TOOL_PARAMETERStool.name · tool.description · tool.parameters
EMBEDDING_MODEL_NAME · EMBEDDING_TEXTembedding.model_name · embedding.text
RETRIEVAL_DOCUMENTSretrieval.documents
SESSION_ID · USER_IDsession.id · user.id
METADATA · TAG_TAGSmetadata · tag.tags

OpenInferenceSpanKind

openinference.span.kind values: CHAIN, LLM, TOOL, RETRIEVER, EMBEDDING, AGENT, RERANKER, GUARDRAIL, EVALUATOR.

BryelConventions

bryel-owned bryel.* extensions, beyond the OpenInference spec:
ConstantValue
COST_USDbryel.cost.usd
COST_STATUSbryel.cost.status
INTERACTION_IDbryel.interaction.id
SIGNAL_TYPE · SIGNAL_VALUEbryel.signal.type · bryel.signal.value
REASONINGbryel.reasoning
CostStatus values: provider_reported, priced, unknown_model, no_tokens.

MimeType

TEXT (text/plain) · JSON (application/json) — used for input.mime_type / output.mime_type.