{"id":28632749,"url":"https://github.com/yezz123/llmgateway-py-sdk","last_synced_at":"2025-06-12T14:38:31.933Z","repository":{"id":298218418,"uuid":"999221907","full_name":"yezz123/llmgateway-py-sdk","owner":"yezz123","description":"Python SDK for llmgateway","archived":false,"fork":false,"pushed_at":"2025-06-10T01:24:56.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-10T02:26:17.524Z","etag":null,"topics":["client","gateway","llm","sdk-python"],"latest_commit_sha":null,"homepage":"https://llmgateway.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yezz123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"yezz123","polar":"yezz123"}},"created_at":"2025-06-09T23:45:02.000Z","updated_at":"2025-06-10T01:24:59.000Z","dependencies_parsed_at":"2025-06-10T02:26:24.550Z","dependency_job_id":"f4ad41d5-116b-4872-8833-e2ffaa7d008f","html_url":"https://github.com/yezz123/llmgateway-py-sdk","commit_stats":null,"previous_names":["yezz123/llmgateway-py-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yezz123/llmgateway-py-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezz123%2Fllmgateway-py-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezz123%2Fllmgateway-py-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezz123%2Fllmgateway-py-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezz123%2Fllmgateway-py-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yezz123","download_url":"https://codeload.github.com/yezz123/llmgateway-py-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yezz123%2Fllmgateway-py-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259483685,"owners_count":22864996,"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","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":["client","gateway","llm","sdk-python"],"created_at":"2025-06-12T14:38:31.193Z","updated_at":"2025-06-12T14:38:31.917Z","avatar_url":"https://github.com/yezz123.png","language":"Python","funding_links":["https://github.com/sponsors/yezz123","https://polar.sh/yezz123"],"categories":[],"sub_categories":[],"readme":"# LLMGateway Python SDK\n\n![LLMGateway Logo](https://github.com/theopenco/llmgateway/blob/main/apps/ui/static/opengraph.png?raw=true)\n\nA Python SDK for interacting with the LLMGateway API.\n\n---\n\n| Project | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| CI      | [![ CI ](https://github.com/yezz123/llmgateway-py-sdk/actions/workflows/ci.yaml/badge.svg)](https://github.com/yezz123/llmgateway-py-sdk/actions/workflows/ci.yaml) [![ Pre-commit ](https://github.com/yezz123/llmgateway-py-sdk/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/yezz123/llmgateway-py-sdk/actions/workflows/pre-commit.yaml) [![ Codecov ](https://codecov.io/gh/yezz123/llmgateway-py-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/yezz123/llmgateway-py-sdk)                                                                                   |\n| Meta    | [![ Package version ](https://img.shields.io/pypi/v/llmgateway-sdk?color=%2334D058\u0026label=pypi%20package)](https://pypi.org/project/llmgateway-sdk) [![ Pydantic Version 2 ](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev) [![ Ruff ](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) |\n\n---\n\n## Installation\n\n```bash\n# using pip\npip install llmgateway-sdk\n\n# using uv\nuv pip install llmgateway-sdk\n\n# using poetry\npoetry add llmgateway-sdk\n```\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom llmgateway import LLMGatewayClient, ChatCompletionRequest, Message\n\n# Initialize the client\nclient = LLMGatewayClient(api_key=\"your-api-key\")\n\n# Create a chat completion request\nrequest = ChatCompletionRequest(\n    model=\"gpt-4\",\n    messages=[\n        Message(role=\"user\", content=\"Hello!\")\n    ]\n)\n\n# Get a completion\nresponse = client.chat_completions(request)\nprint(response.message)\n\n# List available models\nmodels = client.list_models()\nfor model in models.data:\n    print(f\"Model: {model.name} (ID: {model.id})\")\n```\n\n### Async Usage\n\n```python\nimport asyncio\nfrom llmgateway import LLMGatewayClient, ChatCompletionRequest, Message\n\nasync def main():\n    client = LLMGatewayClient(api_key=\"your-api-key\")\n\n    request = ChatCompletionRequest(\n        model=\"gpt-4\",\n        messages=[\n            Message(role=\"user\", content=\"Hello!\")\n        ]\n    )\n\n    # Get a completion asynchronously\n    response = await client.achat_completions(request)\n    print(response.message)\n\n    # List models asynchronously\n    models = await client.alist_models()\n    for model in models.data:\n        print(f\"Model: {model.name} (ID: {model.id})\")\n\n    # Don't forget to close the client\n    await client.aclose()\n\nasyncio.run(main())\n```\n\n### Streaming Responses\n\n```python\nfrom llmgateway import LLMGatewayClient, ChatCompletionRequest, Message\n\nclient = LLMGatewayClient(api_key=\"your-api-key\")\n\nrequest = ChatCompletionRequest(\n    model=\"gpt-4\",\n    messages=[\n        Message(role=\"user\", content=\"Tell me a story\")\n    ],\n    stream=True\n)\n\n# Get streaming responses\nfor response in client.chat_completions(request):\n    print(response.message, end=\"\", flush=True)\n```\n\n## Features\n\n- Synchronous and asynchronous API support\n- Streaming responses\n- Type hints and validation using Pydantic\n- Comprehensive test coverage\n- Modern Python packaging with pyproject.toml\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezz123%2Fllmgateway-py-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyezz123%2Fllmgateway-py-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyezz123%2Fllmgateway-py-sdk/lists"}