Axllm: TypeScript용 DSPy
hackernews
|
|
🔬 연구
#anthropic
#axllm
#dspy
#llm
#openai
#review
#typescript
#에이전트
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
Axllm brings the DSPy framework to TypeScript, enabling developers to build language model applications within the TypeScript ecosystem. This provides TypeScript users with a structured programming model for composing and optimizing AI systems.
본문
DSPy for TypeScript Declare signatures, not prompts. Ax compiles type-safe inputs and outputs into optimized LLM calls — then chains them into agents, flows, and self-improving pipelines. Why teams choose Ax Built for production from day one Production-Ready Streaming, validation with auto-retry, OpenTelemetry observability, structured error handling. Dependencies Only 2 optional peer deps (OpenTelemetry + dayjs). Your bundle stays lean. Universal Runtime Works in Node.js, Deno, and browsers. Web Workers for sandboxed execution. GEPA Optimizer Returns Pareto frontiers — balance accuracy vs speed vs cost. Pick the optimal trade-off. Recursive Language Model Long-context analysis with persistent sessions and iterative refinement. Keeps long context out of root prompt. AxAgent ReAct loops, tool calling, child agents, context policies, dynamic function discovery. Simple & Powerful Define what you want, not how to prompt for it import { ax, ai } from '@ax-llm/ax'// Create an AI instanceconst llm = ai({ name: 'openai' })// Define a classifier with a signatureconst classify = ax( 'review:string -> sentiment:class "positive, negative, neutral"')// Run itconst result = await classify.forward(llm, { review: 'This product is amazing!'}) { sentiment: 'positive'} Two ways to define signatures Quick string syntax for simple tasks. Fluent builder for complex structured outputs with validation. import { f, ax, ai } from '@ax-llm/ax'const sig = f() .input('document', f.string().min(10)) .output('summary', f.string().max(500)) .output('entities', f.object({ name: f.string().min(1), type: f.class(['person', 'org', 'place']), confidence: f.number().min(0).max(1), }).array()) .output('contact', f.object({ email: f.email(), website: f.url().optional(), })) .output('tags', f.string().array()) .build()const gen = ax(sig)const result = await gen.forward(llm, { document: contractText}) { summary: 'Service agreement between...', entities: [ { name: 'Acme Corp', type: 'org', confidence: 0.95 }, { name: 'Jane Smith', type: 'person', confidence: 0.88 }, ], contact: { email: '[email protected]', website: 'https://acme.com' }, tags: ['contract', 'legal', 'NDA']} Autonomous agents, built in AxAgent combines ReAct reasoning with a recursive language model — a persistent JavaScript sandbox that keeps long context out of the root prompt. ReAct Loops & RLM Multi-turn autonomous reasoning with a persistent JavaScript sandbox. State survives across turns — long context stays out of the root prompt. Hierarchical Agents Delegate subtasks to child agents with shared state and namespaced functions. Discover tools at runtime — the agent picks what it needs. Adaptive Context Choose full, adaptive, or lean memory policies. Old context compresses into checkpoint summaries automatically, keeping prompts focused. Production-ready from day one Extensive test coverage, full OpenTelemetry integration, cost tracking, and enterprise-grade error handling — built in, not bolted on. OpenTelemetry Full distributed tracing with spans per LLM call, function invocation, and agent turn. Drop-in Jaeger, Prometheus, or cloud exporters. Detailed Metrics Token usage, latency histograms, error rates, context window utilization, and thinking budget tracking — all as OpenTelemetry metrics. Streaming & Validation End-to-end streaming with structured output validation. Auto-retries on schema failures with error correction built in. Cost Tracking Per-request cost estimation across all providers. Budget monitoring, optimization insights, and cost allocation labels. Multi-Runtime Same code runs in Node.js, Deno, and browsers. Web Workers for sandboxed execution — deploy anywhere. Enterprise Ready Rate limiting, configurable sampling, content redaction, error handling with hindsight evaluation, and custom metric creation. What's in the box Everything you need to build production AI applications AxGen The generator engine. Define signatures, get structured LLM outputs with streaming, assertions, and auto-retry. AxAI 15+ LLM providers through one unified interface. OpenAI, Anthropic, Google, and more. AxAgent Agents with tools, child agents, and ReAct loop machines for complex multi-step tasks. AxAgent Optimize Tune agents with judges, eval datasets, and reusable optimized artifacts. AxFlow Pipeline orchestration with auto-parallelism and DAG execution. AxLearn Self-improving optimization with teacher-student training. AxSignature Type-safe I/O schemas with validation constraints. AxRAG Retrieval-augmented generation with built-in chunking and reranking. DSPy Notebook Interactive playground to experiment with signatures and prompts live. Declare capabilities, not prompts Define your inputs and outputs with type-safe signatures. Ax generates the optimal prompt automatically. Classification Categorize text into predefined classes 'text:string -> category:class "spam, ham, promo"' Extraction Pull structured data from unstructured text 'document:string -> names:string[], dates:date[], amoun
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유