Principle:AI Shell Team Aish Connectivity Verification
| Knowledge Sources | |
|---|---|
| Domains | Configuration, API_Integration, Verification |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Two-layer verification pattern for confirming that an LLM provider endpoint is reachable and supports tool/function calling before committing to a configuration.
Description
Connectivity Verification is a two-layer probe performed during setup to ensure the selected provider, model, and credentials work correctly. Layer 1 sends a minimal chat completion request to verify basic connectivity (the endpoint responds, the API key is valid, the model exists). Layer 2 sends a chat completion request with tool definitions to verify the model supports function calling — a critical capability for an agentic shell.
The verification routes to provider-specific implementations because different providers use different API dialects (OpenAI completions, Anthropic messages, Codex responses). Each dialect has its own request format and response parsing. The result includes latency measurement and clear error messages for diagnosis.
This pattern solves the problem of validating a configuration before the user starts interacting, preventing frustrating mid-session failures due to invalid credentials or unsupported models.
Usage
Use this principle when an application must validate LLM provider configuration before first use. The two-layer approach separates basic reachability from capability detection, so a user can see whether their provider works at all before learning whether it supports tools.
Theoretical Basis
The verification is a layered probe with dialect routing:
# Abstract algorithm (NOT real implementation)
def check_connectivity(provider_key, api_base, api_key, model, timeout):
dialect = route_by_provider(provider_key)
result = send_minimal_chat(dialect, api_base, api_key, model, timeout)
return ConnectivityResult(ok=result.ok, latency=result.latency, error=result.error)
def check_tool_support(provider_key, api_base, api_key, model, timeout):
dialect = route_by_provider(provider_key)
result = send_chat_with_tools(dialect, api_base, api_key, model, timeout)
return ToolSupportResult(supports=result.has_tool_calls, error=result.error)
Key design ideas:
- Layered probing: Layer 1 (connectivity) is cheap; Layer 2 (tool support) is more expensive but only runs if Layer 1 passes
- Dialect routing: the same verification concept adapts its HTTP request format per provider
- Timeout-bounded: each layer has its own timeout to prevent hanging