{"id":18266286,"url":"https://github.com/ssube/feedme","last_synced_at":"2025-04-09T02:19:38.071Z","repository":{"id":234995322,"uuid":"789873144","full_name":"ssube/feedme","owner":"ssube","description":"a personalized, offline, imaginary social media feed","archived":false,"fork":false,"pushed_at":"2024-05-01T02:20:47.000Z","size":2619,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T20:40:24.339Z","etag":null,"topics":["ensemble","feed","image-generation","llm","offline","recommendation-algorithm","social-media","text-generation"],"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/ssube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-04-21T19:29:07.000Z","updated_at":"2024-05-01T02:20:50.000Z","dependencies_parsed_at":"2025-02-14T20:37:27.435Z","dependency_job_id":"8dda4d44-cf15-4e52-a92e-519cc23f38c5","html_url":"https://github.com/ssube/feedme","commit_stats":null,"previous_names":["ssube/feedme"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssube%2Ffeedme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssube%2Ffeedme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssube%2Ffeedme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssube%2Ffeedme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssube","download_url":"https://codeload.github.com/ssube/feedme/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247962675,"owners_count":21024879,"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":["ensemble","feed","image-generation","llm","offline","recommendation-algorithm","social-media","text-generation"],"created_at":"2024-11-05T11:22:44.870Z","updated_at":"2025-04-09T02:19:38.036Z","avatar_url":"https://github.com/ssube.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FeedMe\n\nGenerate your own personalized social media feed at home! Decide what you want to see and how much, or just let it run\nin a loop and see what happens. The algorithm is yours, this is your feed, and you decide what you want to see. Runs\nagainst your local image gen and LLM servers, no cloud services required.\n\nEnter a few topics or ideas and make your own custom image feed complete with post titles, descriptions, and even\ngallery web pages. Sit back and watch as the adventurous agents in the default dataset explore the world and discover\nfascinating new places, or make them all creepy relatives selling Tupperware and watch the disaster unfold.\n\nSample feeds:\n\n- [example dataset](https://examples.perpetualvoid.ai/index.html)\n- [landscape dataset](https://landscape.perpetualvoid.ai/index.html)\n- [liminal spaces dataset](https://liminal.perpetualvoid.ai/index.html)\n\nBuilt with [Langchain](https://github.com/langchain-ai/langchain) and [PACkit](https://github.com/ssube/packit).\n\nThis project started as a joke. The initial goal was to find out whether a completely automated process could produce\ncoherent social media posts. The results were better than expected, especially in topical similarity between the text\nand images, so I cleaned up the code to share and I am working on writing up the prompt generation process.\n\n\u003cimg src=\"https://raw.githubusercontent.com/ssube/feedme/main/docs/banner.png\" height=\"480\" alt=\"orange cartoon monster posting on the internet\"\u003e\n\n## Contents\n\n- [FeedMe](#feedme)\n  - [Contents](#contents)\n  - [Requirements](#requirements)\n  - [Running](#running)\n    - [Configuration](#configuration)\n    - [Docker](#docker)\n  - [Architecture](#architecture)\n  - [Customizing](#customizing)\n    - [Compatible models](#compatible-models)\n      - [Compatible GPT2s](#compatible-gpt2s)\n      - [Compatible LLMs](#compatible-llms)\n      - [Compatible SD checkpoints](#compatible-sd-checkpoints)\n    - [Interests](#interests)\n      - [Generating more interests](#generating-more-interests)\n    - [Prompts](#prompts)\n      - [Images without people](#images-without-people)\n\n## Requirements\n\nRuns locally, no cloud services required (or recommended).\n\n- Requires Python 3.10 or better.\n- Compatible with [Ollama](https://github.com/ollama/ollama) and [vLLM](https://github.com/vllm-project/vllm) for text\n  generation (and other OpenAI-compatible APIs).\n- Compatible with [ComfyUI](https://github.com/comfyanonymous/ComfyUI) and [onnx-web](https://github.com/ssube/onnx-web)\n  for image generation.\n\nVRAM requirements depend on the size of the images and the LLM you select.\n\n- 0GB VRAM minimum, everything can run on CPU (64GB main memory recommended).\n- 32GB VRAM recommended for SDXL and Mistral (2x16GB GPUs works well).\n- 64GB VRAM recommended for hires and Mixtral (1x24GB + 1x40GB, for example).\n- 96GB VRAM recommended for Smaug and other Qwen-based models (1x16GB + 1x80GB, for example).\n\nSmaller models like Mistral should produce a post every 3-5 minutes, depending on GPU performance and success rate of\nthe ensemble voting.\n\nRunning the bot with one GPU is possible, if it has enough memory to run both models, or one of the models has been\noffloaded to CPU. With Mixtral and other mid-sized LLMs running on CPU, it should produce a post every 15-30 minutes.\n\n## Running\n\nBefore launching the bot, browse through the `feedme/data` folder and modify the inputs as desired.\n\nThe topics and ideas used by the bot to generate posts are in the `agents.yaml` file, under the `interests` key. This\nis a dictionary or map, with a keyword as key and the agent's specialty as the value. For example:\n\n```yaml\ninterests:\n    food: You are a talented chef who enjoys cooking at home and taking pictures of beautifully-prepared meals.\n    garden: You are an avid gardener who loves growing plants and documenting their progress with photographs.\n    landscape: You are a landscape photographer, traveling the world to capture exotic vistas.\n```\n\nFor each post, one or more of the interests will be randomly selected and agents created to represent them. Each agent\nis asked to come up with an idea, and after some debate between them, the best ideas will be turned into social media\nposts. Each post will have a title, description, and some pictures attached.\n\nRun the bot with:\n\n```shell\npython3 -m feedme.multi_post | tee -a /tmp/feedme.log\n```\n\n### Configuration\n\n- Set `DEBUG` to wait for an interactive debugger to attach before starting\n- Set `FEEDME_ENV` to load a `.env` file\n- Set `FEEDME_DATA` to the dataset folder that you want to use (defaults to [`feedme/data`](./feedme/data/))\n- Set `FEEDME_DEST` to the output folder that you want to use (defaults to `/tmp/feedme-posts`)\n- Set `IMAGE_TOOL=comfy` and `COMFY_API` to use ComfyUI for image generation\n- Set `IMAGE_TOOL=onnx` and `ONNX_API` to use onnx-web for image generation\n- Set `PACKIT_DRIVER=ollama` and `OLLAMA_API` to use Ollama for text generation\n- Set `PACKIT_DRIVER=openai` and `OPENAI_API_BASE` to use vLLM for text generation (or other OpenAI-compatible APIs)\n- Set `POST_TOOL=civitai` and `CIVITAI_SESSION` to upload posts to Civitai\n- Set `POST_TOOL=html` to generate HTML pages for each post\n- Set `PACKIT_TRACER=traceloop` and `TRACELOOP_BASE_URL` to enable [Traceloop\n  OpenLLMetry](https://github.com/traceloop/openllmetry) (compatible with self-hosted [Grafana\n  Tempo](https://grafana.com/oss/tempo/))\n\nYou can set the `*_API` variables even if they are not being used and switch back and forth with the `*_TOOL`\nvariables.\n\nIf you are using a private GPT2 model for generating example prompts, you will need to set `HF_TOKEN` to a HuggingFace\nAPI token that has permission to download that model.\n\nIf you are posting to Civitai, you will need to set `CIVITAI_SESSION` to a session cookie.\n\nNote that the `COMFY_API` variable _must not_ have a protocol, since it uses both HTTP and websockets.\n\n### Docker\n\n```shell\ndocker run \\\n    --rm \\\n    -it \\\n    -v ./feedme/data:/feedme/feedme/data:ro \\\n    -v /tmp/feedme-posts:/tmp/feedme-posts:rw \\\n    -e FEEDME_DEST=/tmp/feedme-posts \\\n    -e IMAGE_TOOL=comfy \\\n    -e POST_TOOL=html \\\n    -e COMFY_API=\"comfyui-server:8188\" \\\n    -e OLLAMA_API=\"http://ollama-server:11434\" \\\n    -e ONNX_API=\"http://onnx-web-server:5000\" \\\n    -e PACKIT_DRIVER=ollama \\\n    ssube/feedme:latest\n```\n\n## Architecture\n\nAgents:\n\n- Social Media Manager\n- Art Critic\n- Scientists for each idea/topic\n\nArchitecture:\n\n![an infographic showing the feedme architecture](./docs/architecture.png)\n\n## Customizing\n\n### Compatible models\n\n#### Compatible GPT2s\n\nThese are listed separately from the LLMs because the GPT2 prompt generation runs within the bot, using specialized\nmodels.\n\n- `Civitai/promptgen-*`\n  - Used `Civitai/promptgen-sfw-250k` for the examples\n- Auto1111 promptgen models\n  - https://huggingface.co/AUTOMATIC/promptgen-lexart\n  - https://huggingface.co/AUTOMATIC/promptgen-majinai-safe\n\nAny GPT2-based model that has been fine-tuned on the `comma, separated, keyword` structure and appropriate keywords\nfor prompting should work.\n\n#### Compatible LLMs\n\nAny LLM supported by your engine (Ollama or vLLM) should work. Some will produce better results than others. The\nMistral and Mixtral family are good general-purpose choices.\n\n- `mistral-openorca`\n  - Small and fast, generally good results\n  - https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca\n  - https://ollama.com/library/mistral-openorca\n- `nous-hermes2-mixtral`\n  - Medium size and performance, good results\n  - Used for the examples\n  - https://huggingface.co/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\n  - https://ollama.com/library/nous-hermes2-mixtral\n- `smaug`\n  - Large but fast on an appropriate GPU, very good results\n  - https://huggingface.co/abacusai/Smaug-72B-v0.1\n  - https://ollama.com/sammcj/smaug\n\n#### Compatible SD checkpoints\n\nAny SD checkpoint supported by your engine (ComfyUI or onnx-web) should work. Some will produce better results than\nothers. Make sure to select a model that matches your subject matter (realistic landscapes, anime characters, etc).\n\nFor SD v1.5:\n\n- https://civitai.com/models/4384/dreamshaper?modelVersionId=128713\n- https://civitai.com/models/14065/faetastic?modelVersionId=16553\n- https://civitai.com/models/4201/realistic-vision-v60-b1?modelVersionId=130072\n\nFor SDXL:\n\n- https://civitai.com/models/112902/dreamshaper-xl?modelVersionId=126688\n- https://civitai.com/models/122606/dynavision?modelVersionId=297740\n- https://civitai.com/models/129681/sdxl-faetastic?modelVersionId=291443\n- https://civitai.com/models/260664/lucignoloxl-fantastic-subjects-photography?modelVersionId=294013\n\nLoRAs and other networks are not supported yet.\n\n### Interests\n\nThe `interests` are what drive the content creation in feedme. A scientist agent is created to represent each of the\ninterests, and a randomly-selected group of scientists are used to generate and rate each post.\n\n#### Generating more interests\n\nIf you don't have any interests of your own, ChatGPT can generate them for you using the following prompt:\n\n\u003e Come up with 10 different topics that would be interesting social media posts, blog topics, or other content that can\n\u003e be shared with pictures. Provide a single keyword for each topic. Format the list with the keyword first, then the\n\u003e topic. For example:\n\u003e\n\u003e - food: You are a talented chef who enjoys cooking at home and taking pictures of beautifully-prepared meals.\n\u003e - garden: You are an avid gardener who loves growing plants and documenting their progress with photographs.\n\u003e - landscape: You are a landscape photographer, traveling the world to capture exotic vistas.\n\nTo fine-tune the output:\n\n\u003e The topics for architecture, fashion, wildlife, travel, art, technology, and music are good. Please write 10 more like\n\u003e that, without duplicating any previous topics.\n\n### Prompts\n\n#### Images without people\n\nTo discourage people and other characters from appearing in the images, remove the `{characters}` section from the\n`generate_prompts` prompt, like so:\n\n```diff\n--- a/feedme/data/prompts.yaml\n+++ b/feedme/data/prompts.yaml\n@@ -93,10 +93,6 @@ generate_prompt: \u003e-\n\n     {example_prompts}\n\n-    The characters are:\n-\n-    {characters}\n-\n     The scene is:\n\n     {scene}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssube%2Ffeedme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssube%2Ffeedme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssube%2Ffeedme/lists"}