Meet Pixel: My AI-Powered Fediverse Bot
I’ve been running my own Pleroma instance at social.curlyphries.net for a while now and recently I decided to take it a step further by building an AI-powered bot that lives there. Meet Pixel - a bot that analyzes news and provides intelligent commentary when you mention it.
What is Pixel?
Pixel is a Fediverse bot that combines real-time news data with local AI analysis to provide thoughtful insights on current events. Instead of relying on cloud-based AI services that might compromise privacy or cost a fortune, Pixel runs entirely on my own infrastructure using open-source tools.
How It Works
The architecture is surprisingly straightforward:
- Social Platform: Pixel runs as a bot account on my Pleroma instance
- News Source: It pulls current events from TheNewsAPI
- AI Analysis: Local Ollama instance processes the data and generates responses
- Interaction: Users can @ mention Pixel to trigger analysis on specific topics
When you mention Pixel in a post, it:
- Fetches relevant news articles from TheNewsAPI
- Processes the information through Ollama (running locally)
- Generates a thoughtful analysis or summary
- Replies to your post with the insights
Why Build This?
There are a few reasons I wanted to create Pixel:
Privacy & Control: By running everything on my own infrastructure, I maintain complete control over the data and interactions. No third-party services logging conversations or training on my data.
Learning Experience: Building a bot that integrates multiple APIs and AI models is a great way to understand how these systems work together. It’s one thing to use ChatGPT; it’s another to build your own pipeline.
Fediverse Community: The Fediverse is all about decentralization and self-hosting. Having a bot that can provide useful information while respecting those principles feels like a natural fit.
Cost Efficiency: Running Ollama locally means no per-token API costs. The trade-off is electricity - running the model on my own hardware does consume power - but it’s still far more economical than cloud API pricing and I have complete control over when and how the model runs.
The Tech Stack
Here’s what powers Pixel:
- Pleroma: The lightweight, efficient Fediverse platform that hosts the bot account
- TheNewsAPI: Provides access to current news articles and headlines
- Ollama: Open-source tool for running large language models locally
- Model: llama3.1:8b (4.92 GB)
- 8 billion parameter model offering a good balance of quality and speed
- Handles all bot responses, research analysis and conversations
- AWS EC2: Cloud infrastructure hosting the Pleroma instance
- Python: Glue code that ties everything together
What Makes It Interesting
The combination of real-time news data with local AI creates some interesting possibilities:
- Fact-checking: Cross-reference claims with current news sources
- Summarization: Get quick summaries of complex news stories
- Perspective: Analyze how different sources cover the same story
- Context: Understand the background and implications of current events
Privacy & Security Considerations
Running a bot on a public social platform requires thinking carefully about security:
- API keys and credentials are properly secured (not hardcoded)
- The bot runs with minimal permissions
- Rate limiting prevents abuse
- The infrastructure is isolated from other services
- No user data is stored beyond what’s necessary for functionality
Beyond Text: Comic-gen
While Pixel focuses on text-based analysis, I’ve also been experimenting with visual content generation through Comic-gen - a custom web application I built that wraps around the FLUX image generation model.
What is Comic-gen?
- Custom interface for generating comic-style images
- Uses FLUX, a state-of-the-art open-source image generation model
- Known for high-quality, detailed images
- Works efficiently at low guidance scales (CFG 1.0)
- Optimized for comic and illustration styles
This isn’t integrated with Pixel yet but it represents another piece of the self-hosted AI puzzle - proving that you can run sophisticated image generation models on your own infrastructure, just like text generation.
Future Plans
I’m constantly thinking about ways to improve Pixel:
- Adding more news sources for diverse perspectives
- Implementing conversation memory for multi-turn discussions
- Creating specialized modes (e.g., tech news, politics, science)
- Improving response quality through prompt engineering
- Adding source citations to responses
- Potentially integrating Comic-gen for visual content in responses
Closing Thoughts
Pixel represents what I love about the Fediverse and self-hosting: the ability to build custom tools that work exactly how you want them to without compromising on privacy or control. It’s not about replacing commercial AI services - it’s about understanding how they work and creating alternatives that align with your values.
The Fediverse is more than just a Twitter alternative. It’s a platform for experimentation, learning and building tools that serve communities rather than shareholders. Pixel is my small contribution to that vision.
Want to learn more about self-hosting Fediverse instances or building your own bots? Feel free to reach out on the Fediverse or check out my other posts on decentralized social media.