{"id":49594691,"url":"https://github.com/zer0contextlost/llmgate","last_synced_at":"2026-05-04T03:10:49.191Z","repository":{"id":354450687,"uuid":"1223717226","full_name":"zer0contextlost/llmgate","owner":"zer0contextlost","description":"Pre-deploy LLM regression testing for CI pipelines","archived":false,"fork":false,"pushed_at":"2026-04-28T15:38:57.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-04-28T17:19:36.020Z","etag":null,"topics":["ci","evaluation","llm","llmops","pytest","python","regression-testing","testing"],"latest_commit_sha":null,"homepage":null,"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/zer0contextlost.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T15:30:59.000Z","updated_at":"2026-04-28T15:34:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zer0contextlost/llmgate","commit_stats":null,"previous_names":["zer0contextlost/llmgate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zer0contextlost/llmgate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0contextlost%2Fllmgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0contextlost%2Fllmgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0contextlost%2Fllmgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0contextlost%2Fllmgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zer0contextlost","download_url":"https://codeload.github.com/zer0contextlost/llmgate/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0contextlost%2Fllmgate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32592746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"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":["ci","evaluation","llm","llmops","pytest","python","regression-testing","testing"],"created_at":"2026-05-04T03:10:48.583Z","updated_at":"2026-05-04T03:10:49.184Z","avatar_url":"https://github.com/zer0contextlost.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# llmgate\n\n**Pre-deploy LLM regression testing for CI pipelines.** Trace your LLM calls, then `llmgate diff baseline current` fails your PR if output quality dropped. No server, no account, SQLite only.\n\n```python\nimport llmgate\n\n@llmgate.trace\ndef answer(question: str) -\u003e str:\n    return my_llm_call(question)\n```\n\nThat's it. Every call is logged locally. When you change your prompt or swap models, run:\n\n```bash\nllmgate diff main feature-branch\n```\n\nIf outputs degraded, the command exits 1 and your PR fails. No server, no account, no config.\n\n---\n\n## Install\n\n```bash\npip install llmgate\n```\n\n## Usage\n\n### 1. Trace your LLM calls\n\n```python\nimport llmgate\nimport os\n\nos.environ[\"LLMGATE_RUN_ID\"] = \"v1.0\"  # set per run, or use git SHA in CI\n\n@llmgate.trace\ndef my_pipeline(query: str) -\u003e str:\n    context = retrieve(query)\n    return llm.complete(f\"{context}\\n\\n{query}\")\n```\n\n### 2. Assert output quality\n\n```python\noutput = my_pipeline(\"What is the capital of France?\")\n\nllmgate.assert_contains(output, \"Paris\")\nllmgate.assert_output(output, lambda s: len(s) \u003c 500, \"response too long\")\nllmgate.assert_similarity(output, baseline, threshold=0.85)\n```\n\n### 3. Diff runs in CI\n\n```bash\n# See all recorded runs\nllmgate runs\n\n# Compare two runs — exits 1 if regressions found\nllmgate diff v1.0 v1.1\n\n# Inspect a specific run\nllmgate show abc123\n```\n\n### 4. GitHub Actions\n\n```yaml\n- name: Run LLM eval suite\n  env:\n    LLMGATE_RUN_ID: ${{ github.sha }}\n  run: python examples/eval_suite.py\n\n- name: Check for regressions\n  run: llmgate diff ${{ github.base_ref }} ${{ github.sha }}\n```\n\n---\n\n## How it works\n\n- All traces are stored in `.llmgate.db` (SQLite, commit it or cache it as a CI artifact)\n- `@llmgate.trace` works with any function that returns a string, or OpenAI/Anthropic response objects\n- `llmgate diff` computes token-level similarity between baseline and current outputs\n- Nothing leaves your machine unless you choose to push the `.db` file\n\n## CLI reference\n\n```\nllmgate runs                          # list all runs with stats\nllmgate show \u003crun-id\u003e                 # inspect calls in a run\nllmgate diff \u003cbaseline\u003e \u003ccurrent\u003e     # compare runs, exit 1 on regression\n  --threshold FLOAT                   # similarity threshold (default: 0.8)\n  --no-fail                           # report only, don't exit 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzer0contextlost%2Fllmgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzer0contextlost%2Fllmgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzer0contextlost%2Fllmgate/lists"}