Free LLM API Instability: Six-Day Observations and Fault-Tolerant Design
This article examines six days of failures across free models on an aggregated LLM API service, analyzes likely causes and business impact, and presents practical design principles, a Python router with cooldown, health checks, monitoring metrics, and fallback strategies for reducing dependence on any single free model.
1. Symptom: Why Free Model Endpoints Fail Frequently
During a six-day observation period, multiple free models on an aggregated model API service began returning upstream errors one after another. Some recovered on a given day; others remained unavailable. More notably, two parameter-size versions in the same model family did not fail in sync: one version began returning errors on a certain date and stayed down for an extended period, while the other still responded during the same period. Later, both failed successively. During the same window, the total number of models marked free on the platform dropped from 18 to 16.
These observations show that free models cannot be treated as a reliable production dependency. Their availability depends on upstream resources, quota policies, and provider operational decisions, which are usually not disclosed to callers and are not announced in advance.
2. Causes
Failures of free model endpoints usually come from the following categories.
- Upstream resource adjustments: Free quotas often run on shared compute. When inference load rises or resources are reallocated, the service provider may tighten quotas, causing requests to time out in the queue or return errors directly.
- Provider policy changes: A model provider may retire an old version, adjust the free scope, or suspend service for a version. Such changes often come without a compatibility period.
- Connection and middleware issues: When connection, authentication, or routing rules between the aggregator and the upstream fail, the caller may see only a generic error code and cannot directly determine which layer has the problem.
- Independent operation of versions in the same family: Different sizes in the same model family may be deployed in different resource pools. One version returning errors does not mean the whole family is unavailable, and the reverse is also true.
With these causes in mind, the design cannot assume that any model present in a model list is usable. Callers need to determine which models are currently available.
3. Practical Business Impact
If business code hard-codes a single free model as the only entry point, the following problems will appear.
- Service interruption: When the model returns an error, the features that depend on it fail directly, and users see blank output or an error message.
- Non-reproducible test results: A test that passes today may fail tomorrow because of upstream changes, making it difficult to distinguish code problems from environment problems.
- High troubleshooting cost: Error messages often contain only a generic upstream description, so the team needs to spend significant time confirming who is responsible.
- Uncontrollable cost and quality: After switching to another model, output style, length, and accuracy may change, and existing prompts and post-processing logic need to be validated again.
Therefore, free endpoints are suitable for experiments, prototype validation, and low-priority offline tasks. Production paths that serve user requests should treat model availability as a metric that needs continuous management.
4. Design Principles
When upstream services are unstable, four basic principles can be followed.
Principle 1: Do not depend on a single model. Configure a group of candidate models for the same type of task and order them by priority. When the primary model is unavailable, switch to a backup model automatically.
Principle 2: Use real call results to judge health. The “available” marker in a model list is not necessarily accurate. A more reliable approach is to record the result of each call, calculate recent success rate and latency, and use that information to decide whether to keep using a model.
Principle 3: Distinguish retryable errors from non-retryable errors. Timeouts, rate limits, and temporary upstream errors are suitable for retries or switching. Parameter errors, authentication failures, and content policy violations should be returned directly and should not be retried repeatedly across multiple models.
Principle 4: Design a degradation path for failures. When all candidate models are unavailable, the system should have an explicit fallback plan, such as returning cached results, using a rule engine for simple requests, or asking users to try again later.
5. Implementation Example: Multi-Model Routing with Cooldown
The following example uses only the Python standard library and shows the basic logic for candidate model selection, failure counting, and cooldown time. request_fn must be replaced with an actual HTTP call, and a reasonable timeout must be set.
import timefrom dataclasses import dataclass@dataclassclass ModelState:name: strfailures: int = 0cooldown_until: float = 0.0class ModelRouter:def __init__(self, models, max_failures=3, cooldown_seconds=300):self.states = {name: ModelState(name) for name in models}self.max_failures = max_failuresself.cooldown_seconds = cooldown_secondsdef available_models(self):"""Return models not currently in cooldown, preserving configured priority order."""now = time.time()return [state.namefor state in self.states.values()if state.cooldown_until <= now]def report_success(self, name):self.states[name].failures = 0def report_failure(self, name):state = self.states[name]state.failures += 1if state.failures >= self.max_failures:state.cooldown_until = time.time() + self.cooldown_secondsstate.failures = 0def call_with_fallback(router, request_fn, prompt, max_attempts=3):"""Try available models in order; return on first success; raise if all fail."""last_error = Nonefor name in router.available_models()[:max_attempts]:try:result = request_fn(name, prompt)router.report_success(name)return resultexcept TimeoutError as exc:# Timeout is a retryable error; record it and switch to the next modelrouter.report_failure(name)last_error = excexcept PermissionError:# Authentication errors are unrelated to the model; raise directly to avoid meaningless retriesraiseraise RuntimeError(f"All candidate models are unavailable. Last error: {last_error}")
There are several points to note in this code. First, available_models returns models in configured order, so model priority can be expressed by adjusting the order of the list. Second, the cooldown mechanism temporarily removes models that fail repeatedly from rotation, avoiding a situation where every request first waits for a known faulty model to time out. Third, exception classification needs to be adjusted according to the actual SDK or API error types; the example only distinguishes timeouts and authentication errors. In production, retry backoff should also be added, and the total time of a single request should be limited.
6. Health Checks and Monitoring Metrics
Failure counting at request time alone cannot detect model recovery in a timely manner. It is recommended to add scheduled probe tasks that periodically call each candidate model with a very short prompt and record the following metrics.
- Success rate: Calculated over a time window, such as the proportion of successful requests in the last ten minutes or the last hour.
- First-token latency and total duration: Continuously rising latency is often a sign of overload, and the model’s priority can be lowered before errors appear.
- Error code distribution: Distinguish timeouts, rate limits, authentication errors, and server errors to help identify the problem type.
- Number of available models: Record the daily count and list changes of available models to assess upstream stability.
Probe frequency needs to be controlled to avoid probe requests themselves consuming too much quota. In general, healthy models can be probed every few minutes, models in cooldown can have longer intervals, and recovered models can be gradually returned to rotation.
7. Degradation and Fallback Strategies
When all candidate models are unavailable, the system should still provide a reasonable response. Common approaches include the following.
- Cache reuse: For identical or similar requests, return the most recent successful result directly. This is suitable for scenarios such as question answering and summarization where results do not change much.
- Rule-based fallback: For simple tasks such as formatting, classification, and keyword extraction, use deterministic rules or traditional algorithms.
- Asynchronous queueing: For tasks that do not need an immediate response, place them in a queue, process them after the model recovers, and notify the user when results are ready.
- Clear user messaging: Tell users that the service is currently busy and provide an estimated recovery time or an alternative entry point, avoiding an unresponsive interface.
The goal of a degradation plan is to keep core flows running, not to fully reproduce the primary model’s output. Teams need to decide in advance which features can be degraded and which features must rely on a high-quality model.
8. Selection Recommendations
Free endpoints and paid endpoints or endpoints backed by a service-level agreement (SLA) usually differ clearly in availability commitments, quota stability, and technical support. The following principles can be used during selection.
- Tier by scenario: Experiments, internal tools, and offline batch processing can use free resources; user-facing real-time features should have at least one primary channel with stable guarantees.
- Preserve migration capability: Use a unified calling interface and put model names and addresses in configuration. When switching providers, only the configuration needs to change, not the business code.
- Review regularly: Calculate model availability and switch counts monthly, and adjust candidate lists and timeout parameters accordingly.
- Control cost boundaries: Multi-model fault tolerance increases the number of requests, so budget limits are needed to prevent abnormal costs caused by retries during an outage.
9. Conclusion
The value of free model endpoints lies in low-barrier experimentation, but their availability is strongly affected by upstream factors and is not suitable as the sole dependency. Developers should treat model calls as an external dependency that requires continuous monitoring. Through multiple model candidates, health statistics, cooldown mechanisms, and fallback strategies, failures of an individual model can be kept within a controllable range. This approach is independent of any specific vendor and also applies to other model services and general external API calling scenarios.
