Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

API Documentation

Complete API reference for the Ax LLM Framework.

Interfaces

AxAgentConfig
AxAgentFeatures
AxAgentic
AxAIAnthropicArgs
AxAIAnthropicContentBlockDeltaEvent
AxAIAnthropicContentBlockStartEvent
AxAIAnthropicContentBlockStopEvent
AxAIAnthropicErrorEvent
AxAIAnthropicMessageDeltaEvent
AxAIAnthropicMessageStartEvent
AxAIAnthropicMessageStopEvent
AxAIAnthropicPingEvent
AxAICohereArgs
AxAIFeatures
AxAIGoogleGeminiArgs
AxAIGoogleGeminiOptionsTools
AxAIGrokOptionsTools
AxAIGrokSearchSource
AxAIHuggingFaceArgs
AxAIMemory
AxAIMetricsInstruments
AxAIOpenAIArgs
AxAIOpenAIBaseArgs
AxAIOpenAIResponseDelta
AxAIOpenAIResponsesArgs
AxAIOpenAIResponsesCodeInterpreterToolCall
AxAIOpenAIResponsesComputerToolCall
AxAIOpenAIResponsesContentPartAddedEvent
AxAIOpenAIResponsesContentPartDoneEvent
AxAIOpenAIResponsesDefineFunctionTool
AxAIOpenAIResponsesErrorEvent
AxAIOpenAIResponsesFileSearchCallCompletedEvent
AxAIOpenAIResponsesFileSearchCallInProgressEvent
AxAIOpenAIResponsesFileSearchCallSearchingEvent
AxAIOpenAIResponsesFileSearchToolCall
AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent
AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent
AxAIOpenAIResponsesFunctionCallItem
AxAIOpenAIResponsesImageGenerationCallCompletedEvent
AxAIOpenAIResponsesImageGenerationCallGeneratingEvent
AxAIOpenAIResponsesImageGenerationCallInProgressEvent
AxAIOpenAIResponsesImageGenerationCallPartialImageEvent
AxAIOpenAIResponsesImageGenerationToolCall
AxAIOpenAIResponsesInputAudioContentPart
AxAIOpenAIResponsesInputFunctionCallItem
AxAIOpenAIResponsesInputFunctionCallOutputItem
AxAIOpenAIResponsesInputImageUrlContentPart
AxAIOpenAIResponsesInputMessageItem
AxAIOpenAIResponsesInputTextContentPart
AxAIOpenAIResponsesLocalShellToolCall
AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent
AxAIOpenAIResponsesMCPCallArgumentsDoneEvent
AxAIOpenAIResponsesMCPCallCompletedEvent
AxAIOpenAIResponsesMCPCallFailedEvent
AxAIOpenAIResponsesMCPCallInProgressEvent
AxAIOpenAIResponsesMCPListToolsCompletedEvent
AxAIOpenAIResponsesMCPListToolsFailedEvent
AxAIOpenAIResponsesMCPListToolsInProgressEvent
AxAIOpenAIResponsesMCPToolCall
AxAIOpenAIResponsesOutputItemAddedEvent
AxAIOpenAIResponsesOutputItemDoneEvent
AxAIOpenAIResponsesOutputMessageItem
AxAIOpenAIResponsesOutputRefusalContentPart
AxAIOpenAIResponsesOutputTextAnnotationAddedEvent
AxAIOpenAIResponsesOutputTextContentPart
AxAIOpenAIResponsesOutputTextDeltaEvent
AxAIOpenAIResponsesOutputTextDoneEvent
AxAIOpenAIResponsesReasoningDeltaEvent
AxAIOpenAIResponsesReasoningDoneEvent
AxAIOpenAIResponsesReasoningItem
AxAIOpenAIResponsesReasoningSummaryDeltaEvent
AxAIOpenAIResponsesReasoningSummaryDoneEvent
AxAIOpenAIResponsesReasoningSummaryPart
AxAIOpenAIResponsesReasoningSummaryPartAddedEvent
AxAIOpenAIResponsesReasoningSummaryPartDoneEvent
AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent
AxAIOpenAIResponsesReasoningSummaryTextDoneEvent
AxAIOpenAIResponsesRefusalDeltaEvent
AxAIOpenAIResponsesRefusalDoneEvent
AxAIOpenAIResponsesRequest
AxAIOpenAIResponsesResponse
AxAIOpenAIResponsesResponseCompletedEvent
AxAIOpenAIResponsesResponseCreatedEvent
AxAIOpenAIResponsesResponseDelta
AxAIOpenAIResponsesResponseFailedEvent
AxAIOpenAIResponsesResponseIncompleteEvent
AxAIOpenAIResponsesResponseInProgressEvent
AxAIOpenAIResponsesResponseQueuedEvent
AxAIOpenAIResponsesStreamEventBase
AxAIOpenAIResponsesToolCallBase
AxAIOpenAIResponsesWebSearchCallCompletedEvent
AxAIOpenAIResponsesWebSearchCallInProgressEvent
AxAIOpenAIResponsesWebSearchCallSearchingEvent
AxAIOpenAIResponsesWebSearchToolCall
AxAIRekaArgs
AxAIService
AxAIServiceImpl
AxAIServiceMetrics
AxAIWebLLMArgs
AxApacheTikaArgs
AxApacheTikaConvertOptions
AxAPI
AxAPIConfig
AxAssertion
AxBaseAIArgs
AxBootstrapCompileOptions
AxBootstrapOptimizerOptions
AxCompileOptions
AxContentProcessingServices
AxCostTracker
AxCostTrackerOptions
AxDBBaseArgs
AxDBBaseOpOptions
AxDBCloudflareArgs
AxDBLoaderOptions
AxDBManagerArgs
AxDBMatch
AxDBMemoryArgs
AxDBPineconeArgs
AxDBQueryService
AxDBService
AxDBWeaviateArgs
AxDockerContainer
AxField
AxFieldProcessor
AxFieldType
AxFlowable
AxFlowAutoParallelConfig
AxFlowBranchContext
AxFlowBranchEvaluationData
AxFlowCompleteData
AxFlowDynamicContext
AxFlowErrorData
AxFlowExecutionStep
AxFlowLoggerData
AxFlowNodeDefinition
AxFlowParallelGroup
AxFlowParallelGroupCompleteData
AxFlowParallelGroupStartData
AxFlowStartData
AxFlowStepCompleteData
AxFlowStepStartData
AxFlowSubContext
AxFlowTypedSubContext
AxForwardable
AxGenMetricsInstruments
AxMCPFunctionDescription
AxMCPInitializeParams
AxMCPInitializeResult
AxMCPJSONRPCErrorResponse
AxMCPJSONRPCNotification
AxMCPJSONRPCRequest
AxMCPJSONRPCSuccessResponse
AxMCPStreamableHTTPTransportOptions
AxMCPToolsListResult
AxMCPTransport
AxMetricsConfig
AxMiPROCompileOptions
AxMiPROOptimizerOptions
AxMiPROResult
AxMultiProviderConfig
AxOptimizationCheckpoint
AxOptimizationProgress
AxOptimizationStats
AxOptimizer
AxOptimizerMetricsConfig
AxOptimizerMetricsInstruments
AxOptimizerResult
AxParetoResult
AxProgrammable
AxProgramOptions
AxPromptTemplateOptions
AxRateLimiterTokenUsageOptions
AxResponseHandlerArgs
AxRoutingResult
AxSamplePickerOptions
AxSignatureConfig
AxSimpleClassifierForwardOptions
AxStreamingAssertion
AxStreamingEvent
AxTunable
AxUsable

Type Aliases

AxAgentOptions
AxAIAnthropicChatError
AxAIAnthropicChatRequest
AxAIAnthropicChatRequestCacheParam
AxAIAnthropicChatResponse
AxAIAnthropicChatResponseDelta
AxAIAnthropicConfig
AxAIAnthropicThinkingConfig
AxAIAnthropicThinkingTokenBudgetLevels
AxAIArgs
AxAIAzureOpenAIArgs
AxAIAzureOpenAIConfig
AxAICohereChatRequest
AxAICohereChatRequestToolResults
AxAICohereChatResponse
AxAICohereChatResponseDelta
AxAICohereChatResponseToolCalls
AxAICohereConfig
AxAICohereEmbedRequest
AxAICohereEmbedResponse
AxAIDeepSeekArgs
AxAIEmbedModels
AxAIGoogleGeminiBatchEmbedRequest
AxAIGoogleGeminiBatchEmbedResponse
AxAIGoogleGeminiChatRequest
AxAIGoogleGeminiChatResponse
AxAIGoogleGeminiChatResponseDelta
AxAIGoogleGeminiConfig
AxAIGoogleGeminiContent
AxAIGoogleGeminiContentPart
AxAIGoogleGeminiGenerationConfig
AxAIGoogleGeminiSafetySettings
AxAIGoogleGeminiThinkingConfig
AxAIGoogleGeminiThinkingTokenBudgetLevels
AxAIGoogleGeminiTool
AxAIGoogleGeminiToolConfig
AxAIGoogleGeminiToolFunctionDeclaration
AxAIGoogleGeminiToolGoogleSearchRetrieval
AxAIGoogleVertexBatchEmbedRequest
AxAIGoogleVertexBatchEmbedResponse
AxAIGrokArgs
AxAIGrokChatRequest
AxAIGroqArgs
AxAIHuggingFaceConfig
AxAIHuggingFaceRequest
AxAIHuggingFaceResponse
AxAIInputModelList
AxAIMistralArgs
AxAIMistralChatRequest
AxAIModelList
AxAIModelListBase
AxAIModels
AxAIOllamaAIConfig
AxAIOllamaArgs
AxAIOpenAIAnnotation
AxAIOpenAIChatRequest
AxAIOpenAIChatResponse
AxAIOpenAIChatResponseDelta
AxAIOpenAIConfig
AxAIOpenAIEmbedRequest
AxAIOpenAIEmbedResponse
AxAIOpenAILogprob
AxAIOpenAIResponsesConfig
AxAIOpenAIResponsesInputContentPart
AxAIOpenAIResponsesInputItem
AxAIOpenAIResponsesOutputItem
AxAIOpenAIResponsesStreamEvent
AxAIOpenAIResponsesToolCall
AxAIOpenAIResponsesToolChoice
AxAIOpenAIResponsesToolDefinition
AxAIOpenAIUrlCitation
AxAIOpenAIUsage
AxAIRekaChatRequest
AxAIRekaChatResponse
AxAIRekaChatResponseDelta
AxAIRekaConfig
AxAIRekaUsage
AxAIServiceActionOptions
AxAIServiceModelType
AxAIServiceOptions
AxAITogetherArgs
AxAIWebLLMChatRequest
AxAIWebLLMChatResponse
AxAIWebLLMChatResponseDelta
AxAIWebLLMConfig
AxAIWebLLMEmbedModel
AxAIWebLLMEmbedRequest
AxAIWebLLMEmbedResponse
AxBalancerOptions
AxChatRequest
AxChatResponse
AxChatResponseFunctionCall
AxChatResponseResult
AxCheckpointLoadFn
AxCheckpointSaveFn
AxDataRow
AxDBArgs
AxDBCloudflareOpOptions
AxDBMemoryOpOptions
AxDBPineconeOpOptions
AxDBQueryRequest
AxDBQueryResponse
AxDBState
AxDBUpsertRequest
AxDBUpsertResponse
AxDBWeaviateOpOptions
AxEmbedRequest
AxEmbedResponse
AxErrorCategory
AxEvaluateArgs
AxExample
AxFieldProcessorProcess
AxFieldTemplateFn
AxFieldValue
AxFlowLogData
AxFlowLoggerFunction
AxFlowParallelBranch
AxFlowState
AxFlowStepFunction
AxFlowTypedParallelBranch
AxFunction
AxFunctionHandler
AxFunctionJSONSchema
AxFunctionResult
AxFunctionResultFormatter
AxGenDeltaOut
AxGenerateErrorDetails
AxGenerateResult
AxGenIn
AxGenOut
AxGenStreamingOut
AxIField
AxInputFunctionType
AxInternalChatRequest
AxInternalEmbedRequest
AxLoggerData
AxLoggerFunction
AxMCPJSONRPCResponse
AxMemoryData
AxMessage
AxMetricFn
AxMetricFnArgs
AxMockAIServiceConfig
AxModelConfig
AxModelInfo
AxModelInfoWithProvider
AxModelUsage
AxMultiMetricFn
AxOptimizerArgs
AxOptimizerLoggerData
AxOptimizerLoggerFunction
AxProgramDemos
AxProgramExamples
AxProgramForwardOptions
AxProgramForwardOptionsWithModels
AxProgramStreamingForwardOptions
AxProgramStreamingForwardOptionsWithModels
AxProgramTrace
AxProgramUsage
AxRateLimiterFunction
AxRerankerIn
AxRerankerOut
AxResultPickerFunction
AxResultPickerFunctionFieldResults
AxResultPickerFunctionFunctionResults
AxRewriteIn
AxRewriteOut
AxSetExamplesOptions
AxStreamingFieldProcessorProcess
AxTokenUsage