Flipper Ollama

The aim of this project is to help push the presence of LLM accessibility on more and more devices, regardless of computing power

Overview

Flipper-Ollama is an innovative project that brings local Large Language Model (LLM) capabilities to the Flipper Zero device. By utilizing WiFi connectivity through an ESP32 board, the application enables users to communicate with Ollama-hosted language models, creating an interactive AI experience on the Flipper Zero platform.

The project started as a modification of the Gemini-Flipper project by D4rKs1D3, adapting it to work with locally hosted Ollama models instead of Google's Gemini API. This shift to local AI models opens up possibilities for custom-trained models and offline operation.

Development Journey

Initial Prototype

The first working prototype was successfully developed by modifying the original Gemini-Flipper codebase. Key changes included:

  • Replaced API key configuration with server URL for Ollama endpoint
  • Maintained the original UI elements for consistency
  • Utilized existing WiFi connection management system

C Application Development

The project then evolved into a native C application for the Flipper Zero, with several key milestones:

  1. WiFi Connectivity:
  • Implementation of automatic connection to known access points
  • WiFi network scanning functionality
  • User interface for network selection
  • Credential management system
  1. Text Input System:
  • Initially developed a custom keyboard implementation
  • Later improved with native text input integration
  • Support for both uppercase and lowercase characters
  • Special character input capabilities
  1. Chat Functionality:
  • Implementation of basic message sending
  • Integration with Ollama server communication
  • Response handling and display

Features

WiFi Management

  • Automatic connection to saved networks
  • Network scanning and selection interface
  • Secure credential storage
  • Seamless reconnection capabilities

Text Input System

  • Native Flipper Zero keyboard integration
  • Support for multiple character sets
  • Intuitive user interface
  • Case switching functionality

Chat Interface

  • Real-time communication with Ollama models
  • Message history display
  • Response formatting
  • Error handling and connection status indicators

Future Plans

Speech-to-Text Integration

  • Custom PCB development with ESP32 and microphone
  • Audio capture capabilities
  • Server-side speech processing
  • Integration with existing chat functionality

Hardware Development

  • Custom ESP32 board design
  • Microphone module integration
  • Optimized power management
  • Compact form factor

Technical Details

ESP32 Firmware

The ESP32 firmware handles:

  • WiFi connection management
  • Server communication
  • Message routing
  • Connection state management

C Application Architecture

The application is built using:

  • ViewDispatcher for scene management
  • Native text input integration
  • Custom UI elements
  • Robust state management

Contributing

The project welcomes contributions in several areas:

  • WiFi connectivity improvements
  • UI/UX enhancements
  • Speech-to-text integration
  • Hardware design optimization

Acknowledgments

Special thanks to:

  • D4rKs1D3 for the original Gemini-Flipper project
  • codeallnight for text input implementation guidance
  • The Flipper Zero community for continued support and feedback

Project Status

The project is actively under development with working WiFi connectivity and chat functionality. Current focus areas include:

  • Improving text input reliability
  • Implementing full chat features
  • Preparing for speech-to-text integration
  • Hardware design and testing

Stay tuned for updates as the project continues to evolve!