Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when writing Java code with `dev.axllm:ax` for provider clients, model selection, OpenAI-compatible calls, Responses, Gemini, Anthropic, routers, and balancers.
.claude/skills/ax-llm-ax-java-ai/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 143% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 139% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 67% | 0% |
This skill helps an agent write Java code with the generated Ax package dev.axllm:ax. Use the generated package API, examples, and manifests; do not import TypeScript-only APIs unless you are editing the TypeScript package.
dev.axllm:ax.API.md and axir-api.json.axir-capabilities.json.examples/.javascript-quickjs, python-pyodide.javaimport dev.axllm.ax.*; var llm = Ax.ai("openai", java.util.Map.of("apiKey", System.getenv("OPENAI_API_KEY")));
The typesafe provider supports required boolean and class outputs. Numeric bounds never define a Score rubric; numbers, freeform strings, optional outputs, arrays, nesting, media, tools, and sampling controls are rejected before transport.
Set provider trueThreshold (or true_threshold) to a finite value in 0,1], default 0.5. Boolean conversion uses noul >= threshold; this policy is local and never sent. Choice returns the selected label without a confidence cutoff.
Use boolean(true "Core task blocked", false "Routine request") and class label descriptions for criteria. Fluent describe_values / describeValues / DescribeValues keeps the same field value type. C++ uses valueDescriptions on its existing field descriptors. Other providers receive readable prompt and schema descriptions.
The separate native client exposes system_one / systemOne / SystemOne and list_models / listModels / ListModels. Native probabilities remain unchanged. Score returns a fractional zero-based rubric position: convert scales explicitly in application code. Entries may be text, structured JSON objects/arrays, or null. Choice allows 1–255 labels; Score requires 2–10 rubric levels. The service context limit covers state, questions, and criteria; Ax never truncates or pretends to count native tokens exactly.
Choice and Score probabilities must be finite values in 0,1], match the criteria keys, and sum to one within an inclusive 0.01 tolerance. Totals of 0.99 and 1.01 are accepted with an allowance for floating-point summation error. Ax preserves the returned probabilities without renormalizing them.
The default model is jev-latest. Use API keys or renewable credential callbacks, the shared HTTP transport, retry settings, timeout, and cancellation. Native model discovery is separate from configured Ax model aliases. Typed native answers retain question names; only TypeScript can infer literal question keys and Choice-label unions at compile time. Other languages use their native typed maps/records/enums.
Typesafe-only balancers propagate the output-schema requirement. Mixed pools retain ordinary prompts and select Typesafe only when the actual request already has a supported schema. Unsupported requests remain excluded during fallback and degradation. Typesafe has no token streaming; the provider returns one completed result through its stream interface.
Runnable signature, native criteria/scoring, and two-program hybrid examples are under src/examples/java/generation/. See https://axllm.dev/java/examples/generation/.
ai / NewAI factory argument selects deployment behavior. The model option selects a model only inside that deployment; never infer request rules from a vendor-looking model ID.openai is the official OpenAI deployment. openai-compatible is the conservative custom-endpoint profile and requires an explicit base URL. Unknown profile names are errors.together profile's URL, authentication, reasoning fields, and effort mapping. Native DeepSeek thinking fields apply only to the deepseek profile.max, mapped to the strongest documented deployment effort.none only where the selected deployment and model document reasoning disablement. Unsupported levels fail before network I/O; dynamic Hugging Face Router routes remain conservative.native, function, and json_object. Exact caller model metadata overrides the first matching profile rule, which overrides the profile default.structuredOutputs / structured_outputs remains the compatibility alias for native JSON Schema only.google/gemma-4-26b-a4b-it-maas rule prefers json_object, excludes native schema, defaults thinking to max, writes nested enable_thinking, and extracts/replays reasoning_content. Unknown Vertex models stay conservative.projectId / project_id and region; optionally select a Vertex endpoint with endpointId / endpoint_id.credentialProvider / credential_provider for expiring Vertex and cloud tokens. It receives profile, operation, method, and URL on every attempt; its headers override static authentication.global, us, eu, and regional Vertex hosts. An explicit baseUrl / base_url takes precedence.contextCache / context_cache or message/function cache flags. Use promptCacheKey / prompt_cache_key for stable affinity; sessionId / session_id is the fallback.get_model_cost / target equivalent uses the shared model catalog, including cache-write pricing and long-context thresholds.examples/. Scripted AxAI fixtures verify routing without live credentials.ProviderRouter for capability-based selection and optional media degradation. When the selected provider supports images, preserve every native image part with its payload, MIME type, detail level, cache and optimization hints, alt text, and ordering with surrounding text.AxBalancer for deterministic ordered/metric failover with its existing retry policy.AxBalancerAdaptiveStrategy only for operational routing among application-approved equivalent aliases. It learns transient reliability and successful latency, combines them with estimated cost and a deadline, and explores with Thompson sampling.AxBalancerStatsStore. The routing-event callback is best-effort analytics and observability, not a state replication mechanism.examples/adaptive_balancer_no_key for store/reducer syntax, then use the cataloged provider-backed adaptive-balancer example for a complete two-route setup.Select gpt-6-astra through the ordinary OpenAI factory. The adapter chooses Responses automatically; existing model defaults are unchanged. Use low reasoning and standard processing. Portable minimal reasoning maps to low; none is rejected. EU residency does not support priority processing.
Keep applications on their generation, agent, and flow entrypoints. Declare only independent tools as background; ordinary and imported MCP tools stay blocking unless the application explicitly changes their declaration. A promise, thread, or MCP hint is not a background declaration. Set asyncMode to off for the ordinary tool loop; chat-only services retain that loop automatically.
Declared-background native agent tools retain the imported MCP schema, handler, namespace, and raw result. Discovery must expose the tool before the model can call it. Invalid arguments are corrected before handler execution; the responder waits for the incorporated result. Native calls appear in action logs and must not be repeated through actor code. Owned child agents inherit selected MCP clients at delegation. Parent stages keep their own clients; none or an empty namespace list passes no parent clients. Explicit child context wins over inherited context. Each run refreshes protocol modules without serializing live client handles into model requests. Cancellation propagates through a delegated child into its pending MCP tool; completed child work is not replayed. Imported MCP tools forward cancellation to context-aware transports, including built-in HTTP. Custom transports using the older send method receive cancellation checks before and after their call; noncooperative work may finish later and its result is discarded. Cancellation does not undo an external action or replay a request. MCP host policy applies to native background calls too. Configure authorizeToolCall in Python, Go, and Java client options, or set_tool_authorizer on C++ and Rust clients before exposing their tools. The callback receives the client and call metadata; returning false denies the call before a tool request is sent. Use shared application policy state when permissions must change during a run.
Register child agents before running the parent: add_child_agent(namespace, name, child) in Python/C++, AddChildAgent in Go, addChildAgent in Java, and with_child_agent in Rust. Registered children are available automatically as namespaced actor calls, such as team.researcher({question}). Calls use discovery, validation, and invocation accounting. Child invocation remains serialized on the owning run thread and owns a separate conversation. Retained callbacks reject calls after the run closes. Controls target paths such as root/team.researcher/executor. Child results return through the parent invocation log, and parent usage includes a children section.
Attach the language-native run controller through forward options for steering, reasoning changes, cancellation, and lifecycle events. Queued and applied are different states. HTTP applies updates at a response boundary; an optional host WebSocket enables native steering. Do not manage response IDs, socket messages, or tool-result submission in application code.
A provisional answer is not successful completion while started tools remain unresolved. Cancellation closes the session, reports unresolved call IDs, and retains unresolved started calls in tool traces and native agent action logs; it cannot undo an external action. Handlers may cooperate through the invocation cancellation context. Late results from noncooperative work must not change a closed run or trigger replay.
Java, C++, and Rust WebSocket adapters track activity when frames arrive. Consuming buffered events does not reactivate a completed response. When no response is active, steering is queued for the next response; an active successor can still receive native steering. Observe lifecycle timing instead of assuming native application.
All five session adapters validate completed raw arguments against the shared Core validator before invoking handlers, including local references, unions, nested schemas, additional properties, and numeric/string/array constraints. Raw schema patterns use shared flagless ECMAScript semantics, including UTF-16, lookarounds, named captures, and backreferences. Invalid arguments enter correction; step exhaustion fails the run.
Independent flow nodes use owned program and client workers. Built-in providers, routers, and balancers supply factories; custom implementations without them run the entire group serially and emit a flow_parallel_fallback trace. Rust does not require Send/Sync on the existing client trait. Rust nested flows and custom AxExecutableProgram implementations use execute_program; an optional AxOwnedProgramFactory constructs state on its worker. Workers deliver events and results to the owner, which merges successful results in plan order. On group failure, cancellation preserves completed diagnostics and discards late deliveries.
Use the provider-backed Astra examples under src/examples/java/generation/, short-agents/, and flows/. All-five generated parity remains under verification in the shared-session AxIR backlog; do not infer full agent, parallel-flow, or transport parity from these examples alone.
Ax.ai, Ax.typesafe, AxAITypesafeClient, AxCancellationToken, AxAIServiceAbortedError, Ax.getSupportedAIModels, OpenAICompatibleClient.CredentialRequest, OpenAICompatibleClient.CredentialProvider, AiClient.ownedWorkerFactory, AxChatSession, AxChatStream, OpenAICompatibleClient, OpenAIResponsesClient, GoogleGeminiClient, AnthropicClient, Map<String, Object>, AxUsageEvent, AxUsageObserver, AxGlobals.setUsageObserver, AxRuntimeHooks, AxRateLimitInfo, AxRateLimiter, AxTracer, AxMeter, AxGlobals, AxGlobals.setRateLimiter, AxGlobals.setTracer, AxGlobals.setMeter, AxBalancer, AxBalancerAdaptiveStrategy, AxBalancerStatsStore, AxInMemoryBalancerStatsStore, AxBalancerAdaptive.createRouteStats, AxBalancerAdaptive.updateRouteStats, AxBalancerAdaptive.sampleRouteHealth, MultiServiceRouter, ProviderRouterprovider-api examples only when the user explicitly has provider credentials available.no-key examples for deterministic local checks and provider request mapping.tools/*/skills/ into user packages.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→pass | 17,201 | 16,939 | -2% | 1 | 1 | 0% | 2,122 | 5,155 | +143% | 0 | 0 | — |
case-01 | fail→pass | 17,128 | 15,459 | -10% | 1 | 1 | 0% | 2,087 | 4,986 | +139% | 0 | 0 | — |
case-02 | fail→pass | 25,541 | 18,548 | -27% | 1 | 1 | 0% | 4,032 | 5,789 | +44% | 0 | 0 | — |
case-03 | fail→pass | 21,168 | 18,582 | -12% | 1 | 1 | 0% | 3,085 | 5,637 | +83% | 0 | 0 | — |
case-04 | pass→pass | 14,039 | 10,369 | -26% | 1 | 1 | 0% | 1,490 | 3,909 | +162% | 0 | 0 | — |
case-05 | pass→pass | 17,463 | 10,553 | -40% | 1 | 1 | 0% | 2,105 | 4,033 | +92% | 0 | 0 | — |
case-06 | fail→pass | 18,394 | 8,729 | -53% | 1 | 1 | 0% | 2,119 | 3,548 | +67% | 0 | 0 | — |
case-07 | pass→pass | 16,721 | 9,493 | -43% | 1 | 1 | 0% | 1,989 | 3,701 | +86% | 0 | 0 | — |
case-08 | pass→pass | 11,683 | 8,401 | -28% | 1 | 1 | 0% | 1,017 | 3,580 | +252% | 0 | 0 | — |
case-09 | fail→pass | 24,740 | 16,820 | -32% | 1 | 1 | 0% | 3,241 | 5,355 | +65% | 0 | 0 | — |
case-11 | pass→pass | 20,913 | 10,566 | -49% | 1 | 1 | 0% | 2,560 | 3,845 | +50% | 0 | 0 | — |
case-12 | fail→pass | 18,512 | 8,863 | -52% | 1 | 1 | 0% | 2,210 | 3,631 | +64% | 0 | 0 | — |
case-13 | fail→pass | 22,305 | 10,182 | -54% | 1 | 1 | 0% | 2,893 | 3,822 | +32% | 0 | 0 | — |
case-14 | pass→pass | 15,596 | 8,225 | -47% | 1 | 1 | 0% | 1,605 | 3,501 | +118% | 0 | 0 | — |
case-15 | pass→pass | 17,351 | 8,410 | -52% | 1 | 1 | 0% | 1,794 | 3,541 | +97% | 0 | 0 | — |
case-16 | pass→pass | 12,695 | 8,195 | -35% | 1 | 1 | 0% | 1,167 | 3,462 | +197% | 0 | 0 | — |
case-17 | fail→pass | 24,537 | 12,059 | -51% | 1 | 1 | 0% | 3,390 | 4,192 | +24% | 0 | 0 | — |
case-18 | fail→pass | 18,114 | 7,300 | -60% | 1 | 1 | 0% | 1,982 | 3,299 | +66% | 0 | 0 | — |
case-19 | fail→pass | 20,387 | 7,928 | -61% | 1 | 1 | 0% | 2,557 | 3,408 | +33% | 0 | 0 | — |
case-20 | pass→pass | 18,418 | 14,808 | -20% | 1 | 1 | 0% | 2,460 | 4,686 | +90% | 0 | 0 | — |
case-21 | pass→pass | 12,847 | 10,629 | -17% | 1 | 1 | 0% | 1,649 | 4,161 | +152% | 0 | 0 | — |
case-22 | pass→pass | 25,038 | 19,127 | -24% | 1 | 1 | 0% | 3,581 | 5,482 | +53% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v6, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 9/2/2026 | +64% |
| gemini-3.6-flash | verified | 8/26/2026 | +50% |
| gemini-3.6-flash | verified | 8/17/2026 | +61% |
| gemini-3.6-flash | verified | 8/10/2026 | +73% |
Other measured skills in the registry, with their headline benchmark lift.