{"id":13588424,"url":"https://github.com/andrewnguonly/Lumos","last_synced_at":"2025-04-08T03:33:57.812Z","repository":{"id":208278862,"uuid":"717917803","full_name":"andrewnguonly/Lumos","owner":"andrewnguonly","description":"A RAG LLM co-pilot for browsing the web, powered by local LLMs","archived":false,"fork":false,"pushed_at":"2025-01-26T15:42:22.000Z","size":11052,"stargazers_count":1498,"open_issues_count":23,"forks_count":106,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-05T19:07:44.339Z","etag":null,"topics":["chrome-extension","langchain","langchain-js","llm","ollama","react","typescript","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/andrewnguonly.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}},"created_at":"2023-11-13T01:00:25.000Z","updated_at":"2025-04-05T15:32:03.000Z","dependencies_parsed_at":"2024-01-08T20:44:36.443Z","dependency_job_id":"a7dec798-9dac-44d8-84c6-891cfac92b08","html_url":"https://github.com/andrewnguonly/Lumos","commit_stats":{"total_commits":158,"total_committers":4,"mean_commits":39.5,"dds":0.01898734177215189,"last_synced_commit":"69ff12ed3da5846eb40c3233e9dcdafb6cb64f60"},"previous_names":["andrewnguonly/lumos"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewnguonly%2FLumos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewnguonly%2FLumos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewnguonly%2FLumos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewnguonly%2FLumos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewnguonly","download_url":"https://codeload.github.com/andrewnguonly/Lumos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247772937,"owners_count":20993627,"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":["chrome-extension","langchain","langchain-js","llm","ollama","react","typescript","webpack"],"created_at":"2024-08-01T15:06:42.369Z","updated_at":"2025-04-08T03:33:57.797Z","avatar_url":"https://github.com/andrewnguonly.png","language":"TypeScript","funding_links":[],"categories":["chrome-extension","TypeScript","webpack","HarmonyOS","Repos","A01_文本生成_文本对话"],"sub_categories":["Windows Manager","大语言对话模型及数据"],"readme":"# Lumos\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/andrewnguonly/Lumos/actions/workflows/ci.yml\" alt=\"CI\"\u003e\u003cimg src=\"https://github.com/andrewnguonly/Lumos/actions/workflows/ci.yml/badge.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://wiki.mutable.ai/andrewnguonly/Lumos\" alt=\"Mutable.ai Auto Wiki\"\u003e\u003cimg src=\"https://img.shields.io/badge/Auto_Wiki-Mutable.ai-blue\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA RAG LLM co-pilot for browsing the web, powered by local LLMs.\n\n![Screenshot of Lumos](./screenshots/lumos_screenshot_5.png)\n\nThis Chrome extension is powered by [Ollama](https://ollama.ai/). Inference is done on your local machine without any _remote_ server support. However, due to security constraints in the Chrome extension platform, the app does rely on _local_ server support to run the LLM. This app is inspired by the [Chrome extension example](https://github.com/mlc-ai/web-llm/tree/main/examples/chrome-extension) provided by the [Web LLM project](https://webllm.mlc.ai/) and the [local LLM examples](https://js.langchain.com/docs/use_cases/question_answering/local_retrieval_qa) provided by [LangChain](https://github.com/langchain-ai/langchainjs).\n\n- [Ollama (Home)](https://ollama.ai/)\n- [Ollama (GitHub)](https://github.com/jmorganca/ollama)\n\n_Lumos. Nox. Lumos. Nox._\n\n## Use Cases\n- Summarize long threads on issue tracking sites, forums, and social media sites.\n- Summarize news articles.\n- Ask questions about reviews on business and product pages.\n- Ask questions about long, technical documentation.\n- ... what else?\n\n## Ollama Server\n\nA local Ollama server is needed for the embedding database and LLM inference. Download and install Ollama and the CLI [here](https://ollama.ai/).\n\n### Pull Image\n\nExample:\n```\nollama pull llama2\n```\n\n### Start Server\n\nExample:\n```\nOLLAMA_ORIGINS=chrome-extension://* ollama serve\n```\n\nTerminal output:\n```\n2023/11/19 20:55:16 images.go:799: total blobs: 6\n2023/11/19 20:55:16 images.go:806: total unused blobs removed: 0\n2023/11/19 20:55:16 routes.go:777: Listening on 127.0.0.1:11434 (version 0.1.10)\n```\n\nNote: The environment variable `OLLAMA_ORIGINS` must be set to `chrome-extension://*` to allow requests originating from the Chrome extension. The following error will occur in the Chrome extension if `OLLAMA_ORIGINS` is not set properly.\n```\nAccess to fetch at 'http://localhost:11434/api/tags' from origin 'chrome-extension://\u003cextension_id\u003e' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.\n```\n\n### macOS\n\nRun `launchctl setenv` to set `OLLAMA_ORIGINS`.\n```\nlaunchctl setenv OLLAMA_ORIGINS \"chrome-extension://*\"\n```\n[Setting environment variables on Mac (Ollama)](https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-mac)\n\n### Docker\n\nThe Ollama server can also be [run in a Docker container](https://hub.docker.com/r/ollama/ollama). The container should have the `OLLAMA_ORIGINS` environment variable set to `chrome-extension://*`.\n\nRun `docker run` with the `-e` flag to set the `OLLAMA_ORIGINS` environment variable:\n```\ndocker run -e OLLAMA_ORIGINS=\"chrome-extension://*\" -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama\n```\n\n## Chrome Extension\n\nIn the project directory, you can run:\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `npm run lint`\n\nRuns `eslint` and `prettier` on `src` and `__tests__` files.\n\n### `npm run build`\n\nBuilds the app for production to the `dist` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### Load Unpacked Extension (Install)\n\nhttps://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked\n\n### Keyboard Shortcut\n\nCreate a keyboard shortcut to make Lumos easily accessible.\n\n1. Navigate to `chrome://extensions/shortcuts`.\n1. Configure a shortcut for Lumos (`Activate the extension`). For example, `⌘L` (`command key` + `L`).\n\n### Releases\n\nIf you don't have `npm` installed, you can download the pre-built extension package from the [Releases](https://github.com/andrewnguonly/Lumos/releases) page.\n\n## Lumos Options\n\nRight-click on the extension icon and select `Options` to access the extension's [Options page](https://developer.chrome.com/docs/extensions/develop/ui/options-page).\n\n- **Ollama Model**: Select desired model (e.g. `llama2`)\n- **Ollama Embedding Model**: Select desired embedding model (e.g. `nomic-embed-text`). Specify the `OLLAMA_MAX_LOADED_MODELS=2` environment variable when starting the Ollama server to allow multiple models to be loaded into memory.\n- **Ollama Host**: Select desired host (defaults to `http://localhost:11434`)\n- **Vector Store TTL (minutes)**: Number of minutes to store a URL's content in the vector store cache.\n- **Content Parser Config**: Lumos's default content parser will extract all text content between a page's `\u003cbody\u003e\u003c/body\u003e` tag. To customize the content parser, add an entry to the configuration.\n- **Enable/Disable Tools**: Enable or disable individual tools. If a tool is enabled, a custom prefix trigger (e.g. \"calc:\") can be specified to override the app's internal prompt classification mechanism.\n- **Enable/Disable Dark Arts**: 😈\n\n### Content Parser Config\n\nEach URL path can have its own content parser. The content parser config for the longest URL path will be matched.\n\n- **chunkSize**: Number of characters to chunk page content into for indexing into RAG vectorstore\n- **chunkOverlap**: Number of characters to overlap in chunks for indexing into RAG vectorstore\n- **selectors**: `document.querySelector()` queries to perform to retrieve page content\n- **selectorsAll**: `document.querySelectorAll()` queries to perform to retrieve page content\n\nFor example, given the following config, if the URL path of the current tab is `domain.com/path1/subpath1/subsubpath1`, then the config for `domain.com/path1/subpath1` will be used (i.e. `chunkSize=600`).\n\n```json\n{\n  \"domain.com/path1/subpath1\": {\n    \"chunkSize\": 600,\n    \"chunkOverlap\": 200,\n    \"selectors\": [\n      \"#id\"\n    ],\n    \"selectorsAll\": []\n  },\n  \"domain.com/path1\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [\n      \".className\"\n    ],\n    \"selectorsAll\": []\n  }\n}\n```\n\nSee docs for [How to Create a Custom Content Parser](./docs/content_parser.md). See documentation for [`querySelector()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) and [`querySelectorAll()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) to confirm all querying capabilities.\n\nExample:\n```json\n{\n  \"default\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [\n      \"body\"\n    ],\n    \"selectorsAll\": []\n  },\n  \"medium.com\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [\n      \"article\"\n    ],\n    \"selectorsAll\": []\n  },\n  \"reddit.com\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [],\n    \"selectorsAll\": [\n      \"shreddit-comment\"\n    ]\n  },\n  \"stackoverflow.com\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [\n      \"#question-header\",\n      \"#mainbar\"\n    ],\n    \"selectorsAll\": []\n  },\n  \"wikipedia.org\": {\n    \"chunkSize\": 2000,\n    \"chunkOverlap\": 500,\n    \"selectors\": [\n      \"#bodyContent\"\n    ],\n    \"selectorsAll\": []\n  },\n  \"yelp.com\": {\n    \"chunkSize\": 500,\n    \"chunkOverlap\": 0,\n    \"selectors\": [\n      \"#location-and-hours\",\n      \"#reviews\"\n    ],\n    \"selectorsAll\": []\n  }\n}\n```\n### Highlighted Content\n\nAlternatively, if content is highlighted on a page (e.g. highlighted text), that content will be parsed instead of the content produced from the content parser configuration.\n\nNote: Content that is highlighted will not be cached in the vector store cache. Each subsequent prompt containing highlighted content will generate new embeddings.\n\n## Shortcuts\n\n- `cmd + c`: Copy last message to clipboard.\n- `cmd + b`: Load clipboard text as a file attachment.\n- `cmd + j`: Toggle `Disable content parsing` checkbox.\n- `cmd + k`: Clear all messages.\n- `cmd + s`: Save chat to Chat History.\n- `cmd + ;`: Open/close Chat History panel.\n- `ctrl + c`: Cancel request (LLM request/streaming or embeddings generation)\n- `ctrl + x`: Remove file attachment.\n- `ctrl + r`: Regenerate last LLM response.\n\nNote: On Windows PC, use the `alt` key instead of `cmd`.\n\n## Chat History\nSave a chat to the Chat History (`cmd + s`). Open the Chat History (`cmd + ;`) and load a previously saved chat.\n\n## Multimodal\n\nLumos supports multimodal models! Images that are present on the current page will be downloaded and bound to the model for prompting. See documentation and examples [here](./docs/multimodal.md).\n\n## File Attachments\n\nFile attachments can be uploaded to Lumos. The contents of a file will be parsed and processed through Lumos's RAG workflow (similar to processing page content). By default, the text content of a file will be parsed if the extension type is not explicitly listed below.\n\nSupported extension types:\n- `.csv`\n- `.json`\n- `.pdf`\n- any plain text file format (`.txt`, `.md`, `.py`, etc)\n\nNote: If an attachment is present, page content will not be parsed. Remove the file attachment to resume parsing page content.\n\n### Image Files\n\nImage files will be processed through Lumos's [multimodal workflow](./docs/multimodal.md) (requires multimodal model).\n\nSupported image types:\n- `.jpeg`, `.jpg`\n- `.png`\n\n### Clipboard Content\n\nClipboard content can be uploaded as a file attachment. Use the `cmd + b` shortcut key to load clipboard text as a file attachment.\n\n## Tools (Experimental)\n\nLumos invokes [Tools](https://js.langchain.com/docs/modules/agents/tools/) automatically based on the provided prompt. See documentation and examples [here](./docs/tools.md).\n\n## Reading\n- [Local LLM in the Browser Powered by Ollama](https://medium.com/@andrewnguonly/local-llm-in-the-browser-powered-by-ollama-236817f335da)\n- [Local LLM in the Browser Powered by Ollama (Part 2)](https://medium.com/@andrewnguonly/local-llm-in-the-browser-powered-by-ollama-part-2-6eb10caf39a1)\n- [Let’s Normalize Online, In-Memory RAG! (Part 3)](https://medium.com/@andrewnguonly/lets-normalize-online-in-memory-rag-88e8169e9806)\n- [Supercharging If-Statements With Prompt Classification Using Ollama and LangChain (Part 4)](https://blog.langchain.dev/supercharging-if-statements-with-prompt-classification-using-ollama-and-langchain/)\n- [Bolstering LangChain’s MemoryVectorStore With Keyword Search (Part 5)](https://medium.com/@andrewnguonly/bolstering-langchains-memoryvectorstore-with-keyword-search-3d35cc278dc1)\n- [A Guide to Gotchas with LangChain Document Loaders in a Chrome Extension (Part 6)](https://medium.com/@andrewnguonly/a-guide-to-gotchas-with-langchain-document-loaders-in-a-chrome-extension-6228369f79f6)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewnguonly%2FLumos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewnguonly%2FLumos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewnguonly%2FLumos/lists"}