{"id":34254920,"url":"https://github.com/aleph-alpha/locust-sse","last_synced_at":"2026-03-10T22:03:36.590Z","repository":{"id":328311345,"uuid":"1112995184","full_name":"Aleph-Alpha/locust-sse","owner":"Aleph-Alpha","description":"Locust plugin for SSE (useful for loadtesting LLMs)","archived":false,"fork":false,"pushed_at":"2025-12-12T09:34:02.000Z","size":158,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T09:38:45.821Z","etag":null,"topics":["llm","llm-loadtesting","loadtesting","locust","locust-plugin","plugin","sse","sse-loadtesting"],"latest_commit_sha":null,"homepage":"","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/Aleph-Alpha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-12-09T11:33:23.000Z","updated_at":"2025-12-12T09:33:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Aleph-Alpha/locust-sse","commit_stats":null,"previous_names":["aleph-alpha/locust-sse"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Aleph-Alpha/locust-sse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleph-Alpha%2Flocust-sse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleph-Alpha%2Flocust-sse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleph-Alpha%2Flocust-sse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleph-Alpha%2Flocust-sse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aleph-Alpha","download_url":"https://codeload.github.com/Aleph-Alpha/locust-sse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aleph-Alpha%2Flocust-sse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30357614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["llm","llm-loadtesting","loadtesting","locust","locust-plugin","plugin","sse","sse-loadtesting"],"created_at":"2025-12-16T12:24:36.164Z","updated_at":"2026-03-10T22:03:36.585Z","avatar_url":"https://github.com/Aleph-Alpha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Locust SSE User\n\nA Locust plugin for testing Server-Sent Events (SSE) endpoints, specifically designed for LLM streaming response benchmarking.\n\n## Installation\n\nYou can install this package using `uv` (recommended) or `pip`.\n\n### Using uv\n\n```bash\nuv add locust-sse\n```\n\n### Using pip\n\n```bash\npip install locust-sse\n```\n\n## Usage\n\nInherit from `SSEUser` in your `locustfile.py` and use the `handle_sse_request` method to make SSE requests.\n\n```python\nfrom locust import task\nfrom locust_sse import SSEUser\n\nclass MyLLMUser(SSEUser):\n    # Set the host for the user\n    host = \"http://localhost:8080\"\n\n    @task\n    def chat(self):\n        # Example payload for a chat completion endpoint\n        payload = {\n            \"model\": \"gpt-4\",\n            \"messages\": [\n                {\"role\": \"user\", \"content\": \"Tell me a joke.\"}\n            ],\n            \"stream\": True\n        }\n\n        # Make the SSE request\n        self.handle_sse_request(\n            url=\"/chat/completions\",\n            params={\"json\": payload},\n            prompt=\"Tell me a joke.\",\n            request_name=\"chat_completion\"\n        )\n```\n\n## Metrics\n\nThis plugin automatically tracks specific metrics relevant to LLM streaming performance and reports them to Locust.\n\n| Metric | Description |\n| :--- | :--- |\n| **TTFT** | **Time To First Token**. Measures the latency from the start of the request until the first \"append\" event is received. |\n| **Prompt Tokens** | Number of tokens in the input prompt (estimated). |\n| **Completion Tokens** | Number of tokens in the generated response (estimated). |\n| **Processing Time** | Total time taken for the entire generation process. |\n\n### How Metrics Appear in Locust\n\nThese metrics are reported as separate entries in the Locust statistics table:\n\n- `{request_name}_ttft`: Latency statistics for the first token.\n- `{request_name}_prompt_tokens`: \"Response Length\" column shows token count.\n- `{request_name}_completion_tokens`: \"Response Length\" column shows token count.\n- `{request_name}`: The main request entry showing total duration.\n\n## Development\n\nThis project uses `uv` for dependency management.\n\n```bash\n# Install dependencies\nuv sync\n\n# Run tests\nuv run pytest\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph-alpha%2Flocust-sse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleph-alpha%2Flocust-sse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph-alpha%2Flocust-sse/lists"}