Giter VIP home page Giter VIP logo

brokegen


UI screenshot UI with settings screenshot

macOS app to chat with local foundation models. Ollama is well-supported, and .gguf files are loaded via llama-cpp-python (put/symlink them in ~/Library/Application Support/faux.brokegen/).
Key differentiator is a focus on data capture and retention; text and inference stats are stored in SQLite databases, which also makes it easy to import data from external sources.

Features

  • Virtually all settings are overrideable (model template, system prompt, start of assistant response, ollama/llama.cpp inference options)
  • Chats can be branched at any point, and inference models re-selected at any point
  • Ollama proxy is built-in, so any messages sent through other apps will be captured and show up in brokegen (only /api/chat requests, not /api/generate). When the server is started, the proxy is available on http://localhost:6635/ollama-proxy.

Minor features:

  • Chats are optionally auto-named by the UI (the naming prompts in the app work best with llama3 models)
  • Overridden prompts/templates are stored in a SwiftData store, while broad settings like "render as markdown" are stored using @AppStorage
  • User/assistant messages can be sent in any order (continue assistant inference even during its turn + keep "saving" user messages without inference), though this depends on the model template + whether the model handles out-of-turn events well.

Requirements

Tested and developed on macOS 14.2+, M1 MBP + 2019 Intel MBP. Pre-built binaries are x86 only, compiled for AVX2 CPU's and will run inference very slowly (estimated 3-6 tokens/sec for quantized mistral-7b, maxing out the 8 CPU cores on an Intel MBP).

If you don't need to run custom models, install Ollama and use that as the inference provider:

  1. Download from https://ollama.ai and open the application.
  2. Once the command-line utility is installed, open a terminal and run ollama pull <MODEL_NAME>. The full list is available at https://ollama.ai/library.
  3. Once the model has finished downloading, you can start using it.

Or, if you would rather use the embedded ollama binary, you can run a command like ./Brokegen.app/Contents/Resources/ollama-darwin pull mistral:7b, and use that for inference.

Development Notes

UI code is kept simpler, a lot of complexity is pulled in through the built-in Python server.

Python code is built with pyinstaller, and run as a service by the SwiftUI app. An embedded copy of ollama is also included, though you'll have to download models yourself.

  • There is some support for reading langchain/FAISS vector stores, but the write code hasn't been added yet. RAG infrastructure is largely there, but I'd prefer to add a DSPy-centered implementation.
  • For newer models like mistral-nemo and llama3.1, scaling the context up to 128k generally consumes more than 64 GB of RAM, so default context size is 512 tokens + user is expected to override these in the UI inference options.
  • The llama-cpp-python provider defaults to CPU inference, which will be significantly slower on Apple Silicon Macs. Override this in inference options ({"n_gpu_layers": -1}), or use Ollama.
  • Multi-modal support is non-existent; the /ollama-proxy endpoint supports forwarding image files to any ollama model that indicates support for it (e.g. llava), but image data will not be captured or replayable.

brokegen's Projects

brokegen icon brokegen

macOS app for interacting with and proxying Ollama traffic. Focused on chat/instruct applications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.