{"id":50504327,"url":"https://github.com/cobanov/websum","last_synced_at":"2026-06-02T14:30:45.713Z","repository":{"id":228982598,"uuid":"775410393","full_name":"cobanov/websum","owner":"cobanov","description":"Summarize web pages and YouTube videos with pluggable LLM backends (Ollama, OpenAI). CLI, library, and Gradio UI.","archived":false,"fork":false,"pushed_at":"2026-05-14T13:18:16.000Z","size":949,"stargazers_count":125,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-14T14:45:10.671Z","etag":null,"topics":["cli","gradio","langchain","llm","ollama","openai","pypi","python","summarization","youtube"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/websum/","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/cobanov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"cobanov","thanks_dev":null,"custom":null}},"created_at":"2024-03-21T10:40:29.000Z","updated_at":"2026-05-14T13:28:31.000Z","dependencies_parsed_at":"2024-05-01T17:56:05.592Z","dependency_job_id":"e24586ff-e035-49e9-a738-72b232392fa1","html_url":"https://github.com/cobanov/websum","commit_stats":null,"previous_names":["cobanov/easy_web_summarizer","cobanov/easy-web-summarizer","cobanov/websum"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cobanov/websum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobanov%2Fwebsum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobanov%2Fwebsum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobanov%2Fwebsum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobanov%2Fwebsum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobanov","download_url":"https://codeload.github.com/cobanov/websum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobanov%2Fwebsum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33827062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"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":["cli","gradio","langchain","llm","ollama","openai","pypi","python","summarization","youtube"],"created_at":"2026-06-02T14:30:44.363Z","updated_at":"2026-06-02T14:30:45.706Z","avatar_url":"https://github.com/cobanov.png","language":"Python","funding_links":["https://buymeacoffee.com/cobanov"],"categories":[],"sub_categories":[],"readme":"# websum\n\n[![CI](https://github.com/cobanov/websum/actions/workflows/ci.yml/badge.svg)](https://github.com/cobanov/websum/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/websum?style=flat-square\u0026cacheSeconds=300)](https://pypi.org/project/websum/)\n[![Python](https://img.shields.io/pypi/pyversions/websum?style=flat-square\u0026cacheSeconds=300)](https://pypi.org/project/websum/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)\n\nSummarize web pages and YouTube videos with pluggable LLM backends. Ships with first-class support for **Ollama** (local) and **OpenAI**, plus an optional Gradio web UI.\n\n## Installation\n\n```bash\n# Library + CLI, with Ollama backend\npip install 'websum[ollama]'\n\n# With OpenAI backend\npip install 'websum[openai]'\n\n# With the Gradio web UI\npip install 'websum[ui,ollama]'\n\n# Everything\npip install 'websum[all]'\n```\n\nUsing `uv`:\n\n```bash\nuv add 'websum[ollama]'\n```\n\n## Quickstart\n\n### Library\n\n```python\nfrom websum import Summarizer, OllamaBackend\n\ns = Summarizer(backend=OllamaBackend(model=\"llama3:instruct\"))\nprint(s.summarize(\"https://cobanov.dev/haftalik-bulten/hafta-13\"))\nprint(s.summarize(\"https://www.youtube.com/watch?v=4pOpQwiUVXc\"))\nprint(s.translate(\"Hello world\", target_language=\"Turkish\"))\n```\n\nSwap the backend without touching anything else:\n\n```python\nfrom websum import Summarizer, OpenAIBackend\n\ns = Summarizer(backend=OpenAIBackend(model=\"gpt-4o-mini\"))\n```\n\n### CLI\n\n```bash\n# Summarize a web page or YouTube URL (auto-detected)\nwebsum summarize https://example.com\n\n# Use OpenAI instead of Ollama\nwebsum summarize https://example.com --backend openai --model gpt-4o-mini\n\n# Translate\nwebsum translate \"Hello world\" --target-language Turkish\n\n# Launch the Gradio UI\nwebsum ui --port 7860\n```\n\nRun `websum --help` for the full command reference.\n\n## API overview\n\n| Object | Purpose |\n| --- | --- |\n| `Summarizer` | High-level API. `summarize(url)`, `summarize_web(url)`, `summarize_youtube(url)`, `translate(text)`. |\n| `SummarizerConfig` | Chunking and language settings. |\n| `OllamaBackend`, `OpenAIBackend` | Built-in backends. Frozen dataclasses with `.build()`. |\n| `LLMBackend` (Protocol) | Implement this to plug in any backend. |\n| `BackendRegistry` | Map string names to backend classes (used by the CLI). |\n\nAll public names are re-exported from the top-level `websum` package and listed in `__all__`.\n\n## Custom backends\n\n```python\nfrom dataclasses import dataclass\nfrom websum import LLMBackend, Summarizer\n\n@dataclass\nclass MyBackend:\n    def build(self):\n        from langchain_anthropic import ChatAnthropic\n        return ChatAnthropic(model=\"claude-3-5-sonnet-latest\")\n\nassert isinstance(MyBackend(), LLMBackend)  # Protocol check\ns = Summarizer(backend=MyBackend())\n```\n\n## Docker\n\n```bash\ndocker build -t websum .\ndocker run -p 7860:7860 websum\n\n# Run when ollama is on the host\ndocker run --network host -p 7860:7860 websum\n```\n\nThe image starts `websum ui` by default.\n\n## Migration from 0.1.x\n\nThe 0.1.x scripts under `app/` (`summarizer.py`, `translator.py`, `yt_summarizer.py`, `webui.py`) are gone. Everything moved into the `websum` package with a typed, importable API.\n\n| Before | After |\n| --- | --- |\n| `python app/summarizer.py -u URL` | `websum summarize URL` |\n| `python app/webui.py` | `websum ui` |\n| `from summarizer import setup_summarization_chain` | `from websum import Summarizer` |\n| Hardcoded `ChatOllama` | `OllamaBackend` / `OpenAIBackend` / custom `LLMBackend` |\n| `pip install -r requirements.txt` | `pip install 'websum[ollama]'` |\n\n## Development\n\n```bash\ngit clone https://github.com/cobanov/websum\ncd websum\nuv sync --all-extras\nuv run pre-commit install\nuv run pytest\nuv run ruff check .\nuv run mypy src/websum\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobanov%2Fwebsum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobanov%2Fwebsum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobanov%2Fwebsum/lists"}