{"id":22610480,"url":"https://github.com/kolger/forty-two","last_synced_at":"2025-07-17T08:33:42.828Z","repository":{"id":245140831,"uuid":"816693960","full_name":"Kolger/forty-two","owner":"Kolger","description":"A Telegram bot that allows you to create your own ChatGPT in Telegram.","archived":false,"fork":false,"pushed_at":"2025-01-23T13:48:30.000Z","size":208,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T08:26:09.277Z","etag":null,"topics":["anthropic","claude","gemini","gpt","gpt-4","openai","self-hosted","telegram"],"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/Kolger.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}},"created_at":"2024-06-18T08:21:43.000Z","updated_at":"2025-01-23T13:48:33.000Z","dependencies_parsed_at":"2025-04-11T08:21:32.553Z","dependency_job_id":"85c6f17c-af2b-4ff9-b519-fe0474d7bfd6","html_url":"https://github.com/Kolger/forty-two","commit_stats":null,"previous_names":["kolger/forty-two"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Kolger/forty-two","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kolger%2Fforty-two","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kolger%2Fforty-two/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kolger%2Fforty-two/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kolger%2Fforty-two/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kolger","download_url":"https://codeload.github.com/Kolger/forty-two/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kolger%2Fforty-two/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265585315,"owners_count":23792716,"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":["anthropic","claude","gemini","gpt","gpt-4","openai","self-hosted","telegram"],"created_at":"2024-12-08T16:07:01.988Z","updated_at":"2025-07-17T08:33:42.810Z","avatar_url":"https://github.com/Kolger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Forty-two is a Telegram bot that allows you to create your own ChatGPT in Telegram with OpenAI GPT, Google Gemini, Anthropic Claude and DeepSeek models.\n\n## Features\n\n- Easy to use and deploy. You just need to set the Telegram and OpenAI/Gemini/Anthropic/DeepSeek API keys and run the bot.\n- Switching between different AI providers with saving the correspondence history.\n- Ask another AI provider for a response to the same question.\n- GPT Vision. You can send images to the bot and ask questions about them.\n- Track your conversation history with GPT.\n- Limit users who can interact with the bot.\n- Log user messages to a file and the console.\n- i18n for system messages. Currently, supports English, Spanish, Catalan and Russian.\n- Fully asynchronous.\n- MIT License.\n\n## Setup\n\n### 1. Create a .env file with the following content:\n\n```\nTELEGRAM_TOKEN=your_telegram_api_key\nOPENAI_API_KEY=your_openai_api_key\n\n# and / or\n# GEMINI_API_KEY=your_gemini_api_key\n# ANTHROPIC_API_KEY=your_anthropic_api_key\n# DEEPSEEK_API_KEY=your_deepseek_api_key\n```\n\n### 2. Run the bot\n\nWith docker-compose:\n\n```bash\ndocker-compose up -d\n```\n\nRun without Docker: \n\n```bash\nuv sync\nalembic upgrade head\npython main.py\n```\n\n## Settings\n\n| Variable              | Description                                                                                                                                                                             | Default Value                                   |\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|\n| TELEGRAM_TOKEN        | Telegram API key.                                                                                                                                                                       | -                                               |\n| OPENAI_API_KEY        | OpenAI API key.                                                                                                                                                                         | -                                               |\n| GEMINI_API_KEY        | Google Gemini API key.                                                                                                                                                                  | -                                               |\n| ANTHROPIC_API_KEY     | Anthropic API key.                                                                                                                                                                      | -                                               |\n| DEEPSEEK_API_KEY      | DeepSeek API key.                                                                                                                                                                       | -                                               |\n| PROVIDER              | Default provider for users. Users then can change their default provider with /provider command. Please note that API_KEY for selected provider is required.                            | OPENAI                                          |\n| DB_STRING             | Database connection string.                                                                                                                                                             | sqlite+aiosqlite:///db.sqlite3                  |\n| MAX_COMPLETION_TOKENS | Maximum tokens for completion.                                                                                                                                                          | 4096                                            |\n| MAX_TOTAL_TOKENS      | Maximum tokens for total output. If AI provider uses more than this amount, the bot will summarize user input.                                                                          | 10000                                           |\n| SYSTEM_PROMPT         | System prompt for GPT.                                                                                                                                                                  | You are a friendly assistant, your name is Rick |\n| OPENAI_MODEL          | OpenAI model.                                                                                                                                                                           | gpt-4o                                          |\n| ANTHROPIC_MODEL       | Anthropic model.                                                                                                                                                                        | claude-3-5-sonnet-20240620                      |\n| GEMINI_MODEL          | Gemini model.                                                                                                                                                                           | gemini-1.5-flash                                |\n| DEEPSEEK_MODEL        | DeepSeek model.                                                                                                                                                                         | deepseek-chat                                    |\n| ALLOWED_USERS         | Comma-separated list of Telegram users who can interact with the bot. You can use both Telegram IDs or Usernames. If None, everyone can interact with the bot. Example: durov,238373289 | None                                            |\n| LOG_MESSAGES          | Log user messages to a file and the console.                                                                                                                                            | False                                           |\n| HISTORY_EXPIRATION    | If the last message from a user occurred more than the specified time in minutes, the message history will be reset.                                                                    | 30                                              |\n| LANGUAGE              | Language for bot system messages. Curretly support en, es, ca, ru.                                                                                                                      | en                                              |\n\n## Obtaining API keys\n\n- [Telegram API key](https://core.telegram.org/bots#6-botfather)\n- [OpenAI API key](https://beta.openai.com/signup/)\n- [Gemini API key](https://ai.google.dev/gemini-api)\n- [Anthropic API key](https://console.anthropic.com/dashboard)\n- [DeepSeek API key](https://platform.deepseek.com/api_keys)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nMade with love in Barcelona","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolger%2Fforty-two","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkolger%2Fforty-two","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolger%2Fforty-two/lists"}