oi

command module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 60 Imported by: 0

README

oi: Chat with Ollama models right from your terminal — with automatic model discovery, Markdown and piping support, and saved conversations.

This project is a forked version of the original library mods, rebuilt with minimal changes to work exclusively with Ollama. Mods is an excellent library, and I really love the charm stuff — their markdown rendering in the terminal is fantastic! However, the Charm folks are now more into their new crush. I still love Mods for its simplicity, but I need features that aren't currently available, which is why this library was built on top of it.

Installation

Binaries will be made available for Linux, macOS and Windows.

For now, just install with go:

go install github.com/GuntuAshok/oi@latest

What's different?

Here are the changes from the original:

  • Ollama Only: This project only supports Ollama. All other APIs and their related code have been trimmed.
  • Model Autodiscovery: Automatically discovers your local Ollama models. You can pick a model immediately, set it as the default without changing any configuration, and the model list updates automatically whenever you pull a new model.
  • Chat Support: Added a simple, non-TUI chat option so you can continue a conversation directly in REPL style from the terminal using the newly introduced --chat option. Just type oi --chat and you're good to go.
  • Performance Fix: Ollama's chat API follows a template with system, user, and assistant roles. Conversations must be sent in that format to properly use the context (KV cache) from earlier messages. If the history isn't formatted this way, Ollama must rebuild the KV cache every time you send a new message — which is probably why mods slowed down when continuing a chat. This project ensures the history is formatted correctly, eliminating the performance drop during continued conversations.
  • Dependencies: No new dependencies were added to the original mods library. A few dependencies related to unused APIs have been removed.
  • New Binary Name: oi — The binary is now named oi. No particular reason — those two letters are adjacent on the keyboard and easy to type.

Usage

You can see the original mods README for all features and how to use the library. Some of it may not be relevant to this project. I will update this README with everything it supports in due course.

Note: Just remember to use oi in commands instead of mods.

Disclaimer

This repository provides small, quality-of-life improvements for my personal use of Ollama. I’m not a regular Go developer outside this library, so I’ll keep changes minimal and stable, but it’s not a fully supported production tool. I still need to test a few things.

Contributions

Bug fixes and small, well-documented improvements are always welcome!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cache
Package cache provides a simple in-file cache implementation.
Package cache provides a simple in-file cache implementation.
ollama
Package ollama implements stream.Stream for Ollama.
Package ollama implements stream.Stream for Ollama.
proto
Package proto shared protocol.
Package proto shared protocol.
stream
Package stream provides interfaces for streaming conversations.
Package stream provides interfaces for streaming conversations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL