{"id":51318060,"url":"https://github.com/thisago/dirtygpt","last_synced_at":"2026-07-01T09:31:52.906Z","repository":{"id":189826008,"uuid":"681383605","full_name":"thisago/dirtygpt","owner":"thisago","description":"A dirty and free way to use ChatGPT in Nim","archived":false,"fork":false,"pushed_at":"2023-10-08T15:32:40.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-02T04:17:51.263Z","etag":null,"topics":["ai","chatgpt","free","implementation","library","nim"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/thisago.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}},"created_at":"2023-08-21T22:43:54.000Z","updated_at":"2023-10-25T21:08:04.000Z","dependencies_parsed_at":"2023-08-21T23:55:53.223Z","dependency_job_id":null,"html_url":"https://github.com/thisago/dirtygpt","commit_stats":null,"previous_names":["thisago/dirtygpt"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/thisago/dirtygpt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisago%2Fdirtygpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisago%2Fdirtygpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisago%2Fdirtygpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisago%2Fdirtygpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thisago","download_url":"https://codeload.github.com/thisago/dirtygpt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisago%2Fdirtygpt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35001648,"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-07-01T02:00:05.325Z","response_time":130,"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":["ai","chatgpt","free","implementation","library","nim"],"created_at":"2026-07-01T09:31:50.294Z","updated_at":"2026-07-01T09:31:52.896Z","avatar_url":"https://github.com/thisago.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\n\u003cimg alt=\"Google Bard Logo\" src=\"https://user-images.githubusercontent.com/74574275/262172715-048dadaa-3bb1-4f3f-ab5f-561c10830f32.png\"\u003e\n\n# DirtyGPT\n\n#### A dirty and free way to use ChatGPT in Nim\n\n**[About](#about) - [How it works?](#how-it-works) - [Installation](#installation) - [Usage](#usage)** - [License](#license)\n\n\u003c/div\u003e\n\n## About\n\nPrompt in ChatGPT web using Nim!\n\nSee this lib working at [cligpt](https://github.com/thisago/cligpt)\n\n## How it works?\n\nWhen you create a new instance of `DirtyGPT`, an http web server starts\nasynchronously, it accept multiple websocket connections and when you query the\nprompt in lib, the server will add your prompt to the queue, and the connected\nuserscripts will request a prompt. When the server sends the prompt to a client\n(userscript), it saves the client ID in prompt and if for some reason the client\ndisconnects, the items bound to that client ID will be cleaned and wait to be\nasked, in higher priority than others.\n\nThe client userscript controls the ChatGPT webpage, when it receives the prompt,\nit fills up the input and clicks in the button to send. When AI is answering, the\nbutton changes, when it returns to their original form, the userscript reads the\noutput HTML, converts it to Markdown and sends back to server (lib). Then it's\navailable to another prompt, the loop will request the next one.\n\n## Installation\n\nInstall the lib with Nimble:\n\n```bash\nnimble install dirtygpt\n```\n\nAnd at installation end you'll see something like this:\n\n```text\n[...]\n\nPlease, don't forget to install the client userscript in your browser: ~/.nimble/pkgs2/dirtygpt-version-hash/userscript.user.js\n```\n\nInstall the provided Javascript userscript path in a userscript manager in your\nbrowser, like [Greasemonkey][greasemonkey] (Violentmonkey doesn't works, the\nbrowser blocks you to open localhost WS)\n\n## Usage\n\nAfter installed the library and userscript, make sure that you have an open tab\nwith [ChatGPT][chatgpt] logged in.\n\nThe usage is simple:\n\n[`prompt.nim`](examples/prompt.nim)\n\n```nim\nimport std/asyncdispatch\nimport pkg/dirtygpt\n\nlet gpt = newDirtyGpt()\n\necho waitFor gpt.prompt \"Hello, are you Google Bard?\"\n\nstop gpt\n```\n\nstdout\n\n```text\nNo, I'm not Google Bard. I'm ChatGPT, an AI language model created by OpenAI. While both Google Bard and I are AI language models designed to generate text-based responses, we come from different organizations and have different underlying technologies. How can I assist you today?\n```\n\n## TODO\n\n- [x] Add pinging because `connectedClients` is just updated when exceeds timeout\n\n## License\n\nThis piece of software is libre, licensed over the MIT license. Feel free to use!\n\n\u003c!-- Refs --\u003e\n\n[greasemonkey]: https://www.greasespot.net/\n[chatgpt]: https://chat.openai.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisago%2Fdirtygpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisago%2Fdirtygpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisago%2Fdirtygpt/lists"}