Use when writing Rust code with `axllm` for named deployment profiles, generic provider clients, model selection, OpenAI-compatible calls, Responses, Gemini, Anthropic, routers, and balancers.
60
70%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./packages/rust/skills/ax-rust-ai/SKILL.mdThis skill helps an agent write Rust code with the generated Ax package axllm. Use the generated package API, examples, and manifests; do not import TypeScript-only APIs unless you are editing the TypeScript package.
axllm.API.md and axir-api.json.axir-capabilities.json.examples/.javascript-quickjs.use axllm::ai;
let llm = ai("openai", options)?;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.ai, AxCredentialRequest, AxCredentialProvider, OpenAICompatibleClient, OpenAIResponsesClient, GoogleGeminiClient, AnthropicClient, AxUsageContext, AxUsageEvent, AxUsageObserver, set_usage_observer, AxBalancer, AxBalancerAdaptiveStrategy, AxBalancerStatsStore, AxInMemoryBalancerStatsStore, create_balancer_route_stats, update_balancer_route_stats, sample_balancer_route_health, 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.If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.