{"id":26031347,"url":"https://github.com/th3w1zard1/llm_fallbacks","last_synced_at":"2025-07-30T01:34:53.997Z","repository":{"id":280615240,"uuid":"942586247","full_name":"th3w1zard1/llm_fallbacks","owner":"th3w1zard1","description":"Aggregates, sorts, and organizes various GenAI LLM providers into easy-to-use elements.","archived":false,"fork":false,"pushed_at":"2025-07-19T20:10:00.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T22:58:18.592Z","etag":null,"topics":["ai","availability","failover","fallback","genai","high","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/th3w1zard1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-04T10:40:57.000Z","updated_at":"2025-07-19T20:10:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa1f580e-32ad-4811-9592-2a75105dfee0","html_url":"https://github.com/th3w1zard1/llm_fallbacks","commit_stats":null,"previous_names":["th3w1zard1/llm_fallbacks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/th3w1zard1/llm_fallbacks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th3w1zard1%2Fllm_fallbacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th3w1zard1%2Fllm_fallbacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th3w1zard1%2Fllm_fallbacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th3w1zard1%2Fllm_fallbacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/th3w1zard1","download_url":"https://codeload.github.com/th3w1zard1/llm_fallbacks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th3w1zard1%2Fllm_fallbacks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267792810,"owners_count":24144932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","availability","failover","fallback","genai","high","llm"],"created_at":"2025-03-06T19:36:11.477Z","updated_at":"2025-07-30T01:34:53.984Z","avatar_url":"https://github.com/th3w1zard1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Fallbacks\n\n[![PyPI version](https://badge.fury.io/py/llm-fallbacks.svg)](https://badge.fury.io/py/llm-fallbacks)\n[![Python Versions](https://img.shields.io/pypi/pyversions/llm-fallbacks.svg)](https://pypi.org/project/llm-fallbacks/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Python library for managing fallbacks for LLM API calls using the [LiteLLM](https://github.com/BerriAI/litellm) library.\n\n## Features\n\n- 🔄 **Automatic Fallbacks**: Gracefully handle API failures by providing alternative models\n- 📊 **Model Filtering**: Filter models based on various criteria like cost, context length, and capabilities\n- 💰 **Cost Optimization**: Sort models by cost to optimize your API usage\n- 🧠 **Model Discovery**: Discover available models and their capabilities\n- 🛠️ **GUI Tool**: Includes a GUI tool for exploring and filtering available models\n\n## Installation\n\n```bash\npip install llm-fallbacks\n```\n\n## Quick Start\n\n```python\nfrom llm_fallbacks import get_chat_models, filter_models, get_fallback_list\n\n# Get all available chat models\nchat_models = get_chat_models()\nprint(f\"Found {len(chat_models)} chat models\")\n\n# Filter models based on criteria\nvision_models = filter_models(\n    model_type=\"chat\",\n    supports_vision=True,\n    max_cost_per_token=0.001\n)\nprint(f\"Found {len(vision_models)} vision-capable models under 0.001 per token\")\n\n# Get a fallback list for a specific model type\nfallbacks = get_fallback_list(\"chat\")\nprint(f\"Recommended fallback order: {fallbacks}\")\n```\n\n## GUI Tool\n\nLLM Fallbacks includes a GUI tool for exploring and filtering available models:\n\n```bash\n# Run the GUI tool\npython -m llm_fallbacks\n```\n\n## API Reference\n\n### Core Functions\n\n- `get_chat_models()`: Get all available chat models\n- `get_completion_models()`: Get all available completion models\n- `get_embedding_models()`: Get all available embedding models\n- `get_image_generation_models()`: Get all available image generation models\n- `get_audio_transcription_models()`: Get all available audio transcription models\n- `get_audio_speech_models()`: Get all available audio speech models\n- `get_moderation_models()`: Get all available moderation models\n- `get_rerank_models()`: Get all available rerank models\n- `get_vision_models()`: Get all available vision models\n- `get_function_calling_models()`: Get all available function calling models\n- `get_parallel_function_calling_models()`: Get all available parallel function calling models\n- `get_image_input_models()`: Get all available image input models\n- `get_audio_input_models()`: Get all available audio input models\n- `get_audio_output_models()`: Get all available audio output models\n- `get_pdf_input_models()`: Get all available PDF input models\n- `get_models()`: Get all available models\n- `get_fallback_list(model_type)`: Get a fallback list for a specific model type\n- `filter_models(model_type, **kwargs)`: Filter models based on various criteria\n\n### Filtering Models\n\nThe `filter_models` function allows you to filter models based on various criteria:\n\n```python\nfrom llm_fallbacks import filter_models\n\n# Get free chat models that support vision\nfree_vision_models = filter_models(\n    model_type=\"chat\",\n    free_only=True,\n    supports_vision=True\n)\n\n# Get models with a minimum context length\nlong_context_models = filter_models(\n    model_type=\"chat\",\n    min_context_length=16000\n)\n\n# Get models from a specific provider\nopenai_models = filter_models(\n    model_type=\"chat\",\n    provider=\"openai\"\n)\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth3w1zard1%2Fllm_fallbacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fth3w1zard1%2Fllm_fallbacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth3w1zard1%2Fllm_fallbacks/lists"}