Troubleshooting¶
Common issues and resolutions for Fast LiteLLM.
Installation Issues¶
ModuleNotFoundError: fast_litellm._rust¶
Cause: The Rust extension was not compiled or installed correctly.
Solutions:
-
Ensure the Rust toolchain is installed:
-
Rebuild with maturin:
-
Verify the extension loads:
maturin develop Fails with Compilation Errors¶
-
Update the Rust toolchain:
-
Clear the build cache and rebuild:
-
Confirm Python 3.8+ is installed:
ImportError: cannot import name X from fast_litellm¶
Cause: Version mismatch or partial installation.
Solution: Reinstall the package:
Runtime Issues¶
Rust Acceleration Not Being Applied¶
Symptom: Performance is similar to vanilla LiteLLM.
Diagnosis:
Solutions:
-
Import
fast_litellmbeforelitellm: -
Check feature flags:
-
Verify patch status:
Feature Auto-Disabled Due to Errors¶
Symptom: Logs show "Feature disabled due to errors" or performance reverts to Python.
Cause: After 10 errors (default threshold), the circuit breaker disables the feature.
Solution: Reset error counts:
from fast_litellm import reset_errors
reset_errors() # reset all features
reset_errors("rust_routing") # reset a specific feature
Slower Than Python for Small Inputs¶
Cause: FFI overhead dominates for small operations.
Expected behavior. Rust acceleration provides clear benefits for:
- Large text tokenization (1000+ characters)
- High-concurrency scenarios
- Connection pooling with many endpoints
- Rate limiting with high cardinality (many unique keys)
For tiny inputs (under ~100 tokens, simple routing with Python dicts), the FFI round-trip can exceed the Rust speedup. See Benchmarks for measured break-even points.
LiteLLM Import Fails on Python 3.9¶
Symptom: TypeError when importing LiteLLM on Python 3.9.
Cause: Some LiteLLM versions use Python 3.10+ syntax such as str | List[str].
Solutions:
- Upgrade to Python 3.10+.
- Pin to an older LiteLLM release that still supports 3.9.
- Fast LiteLLM swallows this error during patch application so its standalone APIs (
SimpleRateLimiter,SimpleConnectionPool, etc.) keep working without LiteLLM.
Full Health Snapshot¶
When opening an issue, run:
import fast_litellm
print(f"Version: {fast_litellm.__version__}")
print(f"Rust available: {fast_litellm.RUST_ACCELERATION_AVAILABLE}")
print(fast_litellm.health_check())
print(fast_litellm.get_patch_status())
print(fast_litellm.get_feature_status())
print(fast_litellm.get_performance_stats())
Getting Help¶
File issues at github.com/neul-labs/fast-litellm/issues. Include:
- Python version (
python --version) - Platform (
uname -aor Windows version) - Fast LiteLLM version (
fast_litellm.__version__) - Output of
fast_litellm.health_check() - Minimal reproduction steps