{"id":29548148,"url":"https://github.com/ovecjoe/llmrelic","last_synced_at":"2025-08-19T15:05:40.989Z","repository":{"id":304812589,"uuid":"1020068481","full_name":"OVECJOE/llmrelic","owner":"OVECJOE","description":"Access popular LLM model names very easily and declare what models your application supports.","archived":false,"fork":false,"pushed_at":"2025-08-08T08:01:45.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-08T09:25:53.562Z","etag":null,"topics":["ai","library","llms"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/llmrelic","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OVECJOE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-15T09:40:46.000Z","updated_at":"2025-08-08T08:01:48.000Z","dependencies_parsed_at":"2025-07-16T00:10:52.829Z","dependency_job_id":"2ba7cfcd-9ef4-42c8-be78-c6cc2371b5c5","html_url":"https://github.com/OVECJOE/llmrelic","commit_stats":null,"previous_names":["ovecjoe/llmrelic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OVECJOE/llmrelic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVECJOE%2Fllmrelic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVECJOE%2Fllmrelic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVECJOE%2Fllmrelic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVECJOE%2Fllmrelic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OVECJOE","download_url":"https://codeload.github.com/OVECJOE/llmrelic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OVECJOE%2Fllmrelic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271173165,"owners_count":24711667,"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-08-19T02:00:09.176Z","response_time":63,"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","library","llms"],"created_at":"2025-07-17T21:01:28.030Z","updated_at":"2025-08-19T15:05:40.981Z","avatar_url":"https://github.com/OVECJOE.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLM Relic\n\nA lightweight Python library that provides easy access to popular LLM model names and allows you to define which models your application supports.\n\n## Why LLM Relic?\n\n- **No more hardcoded model names**: Access standardized model names from major providers\n- **Easy support definition**: Fluent interface to define which models your app supports\n- **Validation**: Built-in validation to ensure only supported models are used\n- **Zero dependencies**: Lightweight library with no external dependencies\n- **Type hints**: Full type hint support for better IDE experience\n\n## Installation\n\n```bash\npip install llmrelic\n```\n\n## Quick Start\n\n### Access Model Names\n\n```python\nfrom llmrelic import OpenAI, Anthropic, Google\n\n# Access model names directly\nprint(OpenAI.gpt_4)  # \"gpt-4\"\nprint(Anthropic.claude_3_opus)  # \"claude-3-opus-20240229\"\nprint(Google.gemini_pro)  # \"gemini-pro\"\n\n# List all models from a provider\nprint(OpenAI.list_models())\n```\n\n### Define Supported Models\n\n```python\nfrom llmrelic import SupportedModels\n\n# Define which models your app supports\nsupported = (SupportedModels.create()\n             .openai()  # All OpenAI models\n             .anthropic([\"claude-3-opus-20240229\", \"claude-3-sonnet-20240229\"])  # Specific models\n             .google()  # All Google models\n             .custom([\"my-custom-model\"])  # Your custom models\n             .build())\n\n# Validate model support\nif supported.is_supported(\"gpt-4\"):\n    print(\"GPT-4 is supported!\")\n\n# Get all supported models\nprint(supported.get_supported_models())\n```\n\n### Use in Your Application\n\n```python\nfrom llmrelic import OpenAI, SupportedModels\n\nclass MyLLMApp:\n    def __init__(self):\n        # Define what models your app supports\n        self.supported_models = (SupportedModels.create()\n                                .openai([\"gpt-4\", \"gpt-3.5-turbo\"])\n                                .anthropic()\n                                .build())\n    \n    def chat(self, model_name: str, message: str):\n        if not self.supported_models.is_supported(model_name):\n            available = \", \".join(self.supported_models.get_supported_models())\n            raise ValueError(f\"Model {model_name} not supported. Available: {available}\")\n        \n        # Your chat logic here\n        return f\"Response from {model_name}\"\n\n# Usage\napp = MyLLMApp()\napp.chat(OpenAI.gpt_4, \"Hello!\")  # Works\napp.chat(\"gpt-4\", \"Hello!\")  # Works\n# app.chat(\"unsupported-model\", \"Hello!\")  # Raises ValueError\n```\n\n## Supported Providers\n\n- **OpenAI**: GPT-4, GPT-3.5-turbo, and more\n- **Anthropic**: Claude 3 Opus, Sonnet, Haiku, and more\n- **Google**: Gemini Pro, Bard, PaLM-2, and more\n- **Cohere**: Command, Command-Light, Command-R, and more\n- **Mistral**: Mistral 7B, Mixtral 8x7B, and more\n- **Meta**: Llama 2, Code Llama, and more\n- **Hugging Face**: Popular open-source models\n- **Moonshot**: moonshot-v1-8k (Kimi K1.5), moonshot-v1-32k (Kimi K2), moonshot-vl-32k (Kimi‑VL)\n\n## API Reference\n\n### Model Providers\n\nEach provider exposes models as attributes:\n\n```python\nfrom llmrelic import OpenAI, Anthropic, Google, Cohere, Mistral, Meta, Huggingface\n\n# Access models\nOpenAI.gpt_4  # \"gpt-4\"\nAnthropic.claude_3_opus  # \"claude-3-opus-20240229\"\nGoogle.gemini_pro  # \"gemini-pro\"\n\n# List all models\nOpenAI.list_models()\n\n# Check if model exists\n\"gpt-4\" in OpenAI  # True\n```\n\n### SupportedModels (Fluent Interface)\n\n```python\nfrom llmrelic import SupportedModels\n\nsupported = (SupportedModels.create()\n             .openai()  # All OpenAI models\n             .openai([\"gpt-4\", \"gpt-3.5-turbo\"])  # Specific OpenAI models\n             .anthropic()  # All Anthropic models\n             .google([\"gemini-pro\"])  # Specific Google models\n             .custom([\"my-model\"])  # Custom models\n             .build())\n\n# Check support\nsupported.is_supported(\"gpt-4\")  # True\n\n# Get models\nsupported.get_models()  # List of all supported models\n```\n\n### ModelRegistry (Direct Interface)\n\n```python\nfrom llmrelic import ModelRegistry\n\nregistry = ModelRegistry()\nregistry.add_provider(\"openai\")\nregistry.add_models([\"custom-model-1\", \"custom-model-2\"])\nregistry.add_model(\"another-model\")\n\n# Check support\nregistry.is_supported(\"gpt-4\")  # True\n\"gpt-4\" in registry  # True\n\n# Get models\nregistry.get_supported_models()\nregistry.get_supported_by_provider()\n\n# Iterate\nfor model in registry:\n    print(model)\n```\n\n## Utility Functions\n\n```python\nfrom llmrelic import get_all_models, find_model\n\n# Get all available models by provider\nall_models = get_all_models()\n\n# Find which provider a model belongs to\nprovider = find_model(\"gpt-4\")  # \"openai\"\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add your changes\n4. Run tests: `pytest`\n5. Submit a pull request\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovecjoe%2Fllmrelic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovecjoe%2Fllmrelic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovecjoe%2Fllmrelic/lists"}