Skip to content

Latest commit

 

History

History
177 lines (130 loc) · 12 KB

reference.md

File metadata and controls

177 lines (130 loc) · 12 KB

Filter Reference

AI filters provided by Praxis AI. For base proxy filters (router, load balancer, headers, CORS, etc.), see the Praxis core filter reference.

Provider APIs (praxis-ai-apis)

Anthropic

Filter Description
anthropic_messages_protocol Normalizes Anthropic Messages protocol headers for native backends.
anthropic_messages_request Processes an Anthropic create-message body once and publishes its facts.
anthropic_messages_to_chat_completions Transforms Anthropic Messages API requests to Chat Completions-compatible request bodies and transforms compatible responses back. The name refers to the Chat Completions wire shape, not the OpenAI Responses API; any Chat Completions-compatible backend is a valid target, not only OpenAI.
anthropic_messages_to_chat_completions_stream Transforms streaming SSE responses between the Chat Completions and Anthropic Messages formats, processing each chunk as it arrives.
anthropic_web_search Executes server-owned WebSearch tool calls in an Anthropic Messages loop.
openai_chat_completions_to_anthropic Translates OpenAI Chat Completions requests only when the selected ExternalModel candidate uses Anthropic Messages; OpenAI candidates pass through with their configured path and model.
openai_chat_completions_to_anthropic_stream Converts the selected Anthropic provider's event stream incrementally. OpenAI-compatible candidates are left byte-for-byte unchanged.

Azure

Filter Description
openai_chat_completions_to_azureai_chat_completions Transforms requests targeting Azure OpenAI deployments into standard Chat Completions-compatible form and normalizes responses back.

General

Filter Description
callout_credentials Establishing filter that captures typed per-user callout secrets from ingress headers.
project_state_owner_headers Projects a normalized [StateOwner] into destination-specific HTTP headers.
state_owner Establishes a normalized [StateOwner] from trusted identity sources.

OpenAI

Filter Description
openai_agentic_loop Agentic loop controller for the Responses API pipeline.
openai_chat_completions_request Publishes body facts for native Chat Completions create requests to durable metadata and filter results.
openai_chat_completions_streaming_selector Selects the typed IRR response transport from an OpenAI Chat Completions request's effective stream bit.
openai_client_tool_compat Lowers rich client-owned tool declarations to private function tools for a function-only Responses backend and restores the typed items on the way back.
openai_conversations Handles all /v1/conversations endpoints locally.
openai_doc_extract Converts input_file content parts to input_text for backends that do not support input_file natively (e.g. vLLM, llm-d).
openai_file_resolve Resolves file_id and file_url references in Responses API input by fetching content from a Files API or remote URL via ApiClient and inlining the base64-encoded content in the provider-native field.
openai_file_search_dispatch Dispatches the loop owner's pending file-search assignments against a vector store API compatible backend.
openai_mcp_dispatch Executes MCP tool calls against upstream MCP servers within the Responses API agentic loop.
openai_mcp_tool_resolve Resolves MCP tool entries from the Responses API tools array into concrete tool definitions by calling tools/list on each upstream MCP server.
openai_responses_compact Summarizes conversation history when the token count exceeds a configured threshold.
openai_responses_model_rewrite Rewrites the model field in Responses and Chat Completions request bodies.
openai_responses_proxy Rebuilds the request body from ResponsesState when present.
openai_responses_rehydrate Validates previous_response_id by fetching the stored response, confirming its status is "completed", and populating ResponsesState with the full conversation history (stored turns + current input).
openai_responses_request Processes a Responses request body once and initializes state.
openai_responses_store Persists Responses API responses to the configured response store backend.
openai_responses_to_chat_completions Translates canonical Responses create requests for a Chat Completions backend.
openai_stream_events Composes the current IRR execution into one logical Responses stream.
openai_tool_parse Parses tool definitions and tool_choice from Responses API request bodies and promotes routing facts to metadata and filter results without mutating the body.
openai_web_search_dispatch Web search filter for model-driven web_search_call dispatch.

Operation Classifier

Filter Description
ai_operation Classifies supported AI operations from the request head.

Vertex

Filter Description
anthropic_messages_to_vertexai_anthropic Translates Anthropic Messages requests to Vertex AI rawPredict and Vertex responses back to the Anthropic dialect.
openai_chat_completions_to_vertexai_gemini Transforms OpenAI Chat Completions requests into Vertex AI Gemini generateContent format and translates responses back.

Cross-Provider Filters (praxis-ai-filters)

Agentic

Filter Description
a2a Extracts A2A protocol metadata from JSON-RPC request bodies and promotes method, family, task ID, streaming detection, and version to request headers, filter results, and durable metadata for routing.
mcp Extracts MCP protocol metadata from JSON-RPC request bodies and promotes method, tool/resource/prompt name, JSON-RPC kind, protocol version, and session presence to request headers/filter results; stores session ID in durable metadata.

AWS

Filter Description
aws_sigv4_sign Signs outbound requests to AWS services using SigV4.

Azure

Filter Description
azure_ad Injects an Azure AD (Entra ID) bearer token into outbound requests.

Callout

Filter Description
http_callout Calls an external HTTP service during request processing and feeds its response into branch-chain evaluation.

GCP

Filter Description
gcp_adc Injects a GCP OAuth2 access token into outbound requests.

Guardrails

Filter Description
ai_guardrails Calls an external AI guardrail provider to evaluate request and response bodies. The provider determines whether content should be passed, blocked, or redacted.

Identity Guard

Filter Description
identity_header_guard Captures request headers matching a configured prefix into filter_metadata and removes them from the upstream request.

Inference

Filter Description
llmisvc_model_provider_resolver Rewrites publisher-ID body model values to the short model name for LLMISvc / KServe routing; the routing header is left unchanged.
model_to_header Promotes the JSON "model" field from the request body to a request header.
model_to_provider Maps stable client-facing model IDs to existing upstream clusters and provider-specific target models.

Inflight

Filter Description
inflight_tracker Tracks live request counts and reserved tokens per model.

Metering

Filter Description
external_metering Integrates with an external metering service for pre-request balance checks and post-response token usage reporting.

Prompt Enrich

Filter Description
prompt_enrich Injects statically configured messages into the messages array of OpenAI-compatible chat completion request bodies.

Routing

Filter Description
credential_inject Replaces caller credentials with the upstream credential selected by intelligent_route or provider_route.
intelligent_route Selects an upstream cluster from a site/capability descriptor by matching either an inference model name or MCP tool name.
provider_route Exact provider-local mapping from an authenticated intelligent routing selection to a private backend cluster.

Time To First Token

Filter Description
time_to_first_token Measures time-to-first-token for streaming AI responses.

Token Rate Limit

Filter Description
token_rate_limit Token-denominated rate limiter: reserves an estimated cost at admission, reconciles against actual usage after the response completes. Evaluates an ordered list of rules, each with its own optional match condition, algorithm choice, and budget.

Token Usage

Filter Description
stream_usage_inject Injects stream_options.include_usage = true into streaming OpenAI chat-completions requests so the upstream response contains token usage.
token_ceiling Rejects provider-bound requests whose estimated serialized request body or requested output exceeds configured limits. Missing output-limit fields are rejected when max_output_tokens is configured; this strict behavior prevents providers from applying an unbounded model default. At least one of max_input_tokens or max_output_tokens is required, and max_body_bytes defaults to 2 MiB.
token_count Extracts token usage from AI inference responses and writes unified counts to [filter_metadata].
token_usage_headers Injects Praxis-Token-Input, Praxis-Token-Output, and Praxis-Token-Total headers into downstream responses when token usage data is present in [filter_metadata]. Also injects Praxis-Token-Status when usage capture failed (e.g. overflow), so an unavailable count is never silently indistinguishable from a genuine zero.
token_usage_metrics Emits bounded per-tenant Prometheus token counters from token.* metadata.