OLLMchat is a work-in-progress AI application for interacting with LLMs (Large Language Models) such as Ollama and OpenAI, featuring a full-featured chat interface with code assistant capabilities including semantic codebase search. The project is built as a modular set of reusable libraries that can be integrated into other applications, with the main application serving as a complete AI chat client. The project focuses on Vala and GTK4, with all libraries written in pure Vala.
- Main Application (
ollmchat) - A complete AI chat client with:- Full-featured chat interface for interacting with LLMs (Ollama/OpenAI)
- Settings dialog with model search and download from Ollama
- Code assistant agent with semantic codebase search capabilities
- Chat history management with session browser
- Tool integration: ReadFile, EditMode, RunCommand, WebFetch, and CodebaseSearch (semantic search)
- Project management and file tracking
- Permission system for secure tool access
- Support for multiple agent types (Just Ask, Code Assistant)
- Libraries - A set of reusable libraries for LLM access, tool integration, and markdown processing
libocmarkdown.so- Markdown parsing and rendering library (no GTK dependencies)libocmarkdowngtk.so- Markdown GTK rendering library (includes GTK components)libocsqlite.so- SQLite query builder library (no GTK dependencies)libocfiles.so- File and project management library (no GTK dependencies)liboccoder.so- Code editor and project management library (includes GTK components)libocvector.so- Semantic codebase search library using vector embeddings and FAISS (no GTK dependencies)libollmchat.so- Base library for Ollama/OpenAI API access (no GTK dependencies)liboctools.so- Tools library for file operations and utilities (no GTK dependencies)libollmchatgtk.so- GTK library with chat widgets (includes GTK components)
- Example Tools - Command-line utilities demonstrating library capabilities:
oc-test-cli- Test tool for LLM API calls (models, chat, streaming)oc-test-files- Test tool for file operations (read/write files with line ranges, project management, buffer operations, backups)oc-markdown-test- Markdown parser test tool (parses markdown and outputs callback trace)oc-html2md- HTML to Markdown converter (reads HTML from stdin, outputs Markdown)oc-md2html- Markdown to HTML converter (converts markdown file to HTML)oc-diff- Unified diff tool (compares two files and outputs differences in unified diff format)oc-vector-index- Codebase indexing tool for semantic search (indexes files/folders using tree-sitter and vector embeddings)oc-vector-search- Command-line semantic code search tool (searches indexed codebase by semantic meaning)oc-migrate-editors- Project migration tool (migrates projects from Cursor editor configuration)oc-test-fetch- Web fetch test tool (fetches web content from URLs with format conversion support)
- Technology Stack - Written in pure Vala, focusing on Vala and GTK4
- Tool Dependencies - Some tools will rely on third-party applications
- Tool Calling - Supports tool calling functionality
- Permission System - Includes a permission system for secure tool access
- Prompt Manipulation - Provides prompt manipulation capabilities
- Generation - Supports text generation from LLM models
- Embeddable Widget - Reusable chat widget (
ChatWidget) that can be embedded in applications
Screencast.From.2025-12-31.17-22-54.mp4
This is using gpt-oss to implement a plan and create code
Screencast.From.2025-12-09.17-10-55.mp4
This is the basic bootstrapping window - and a walk around some of the earlier features.
Note: If the videos above dont display, you can
Online API documentation is available:
- ollmchat API Reference - Unified library documentation (base and UI)
Implementation plans and roadmap:
- Implementation Plans Summary - Overview of all planned features with status indicators
This directory contains the OLLMchat library and test applications for working with Ollama API and prompt generation.
Before building, install the required dependencies. On Debian/Ubuntu systems:
sudo apt install \
meson \
ninja-build \
valac \
valadoc \
libgee-0.8-dev \
libglib2.0-dev \
libgtk-4-dev \
libgtksourceview-5-dev \
libadwaita-1-dev \
libsoup-3.0-dev \
libjson-glib-dev \
libxml2-dev \
libsqlite3-dev \
libgit2-glib-1.0-dev \
gobject-introspection \
libgirepository1.0-dev \
libomp-dev \
libfaiss-dev \
libtree-sitter-dev \
desktop-file-utils \
build-essential \
pkg-configFor code search functionality, you'll also need:
-
Tree-sitter language parsers: Install tree-sitter parsers for the languages you want to index. A script is available at
docs/tools/tree-sitter-packages.phpto generate Debian packages for tree-sitter language parsers from GitHub repositories. -
Ollama models: For vector search to work, you need to have the following models available in Ollama:
bge-m3:latest- For generating embeddingsqwen3-coder:30b- For code analysis and description generation
You can download these models through the settings dialog in the application, or manually using:
ollama pull bge-m3:latest
ollama pull qwen3-coder:30bFor RunCommand tool (command execution with overlay filesystem support), you'll also need:
sudo apt install \
bubblewrap- bubblewrap - Provides
bwrapcommand for sandboxed command execution
To build the project, follow these steps:
From the project root directory, run:
meson setup build --prefix=/usrThis will configure the build system with Meson and set the installation prefix to /usr.
After setup, compile the project using:
ninja -C buildThis will build:
libocmarkdown.so- Markdown parsing library (with headers, VAPI, and GIR files)libocmarkdowngtk.so- Markdown GTK rendering library (with headers, VAPI, and GIR files)libocsqlite.so- SQLite query builder library (with headers, VAPI, and GIR files)libocfiles.so- File and project management library (with headers, VAPI, and GIR files)liboccoder.so- Code editor and project management library (with headers, VAPI, and GIR files)libocvector.so- Semantic codebase search library (with headers, VAPI, and GIR files)libollmchat.so- Base library for LLM API access (with headers, VAPI, and GIR files)liboctools.so- Tools library for file operations and utilities (with headers, VAPI, and GIR files)libollmchatgtk.so- GTK library with chat widgets (with headers, VAPI, and GIR files)ollmchat- Main application executableoc-test-cli- Command-line test executableoc-markdown-test- Markdown parser test executableoc-html2md- HTML to Markdown converter (reads from stdin)oc-md2html- Markdown to HTML converter (takes file as argument)oc-diff- Unified diff tool (compares two files and outputs differences)oc-vector-index- Vector indexing tool for codebase search (indexes files/folders for semantic search)oc-vector-search- Command-line semantic code search tooloc-migrate-editors- Project migration tooloc-test-fetch- Web fetch test tool (fetches web content from URLs)- Valadoc documentation (in
docs/ollmchat/)
The executables are configured with build_rpath so they can find the libraries in the build directory without needing to install them. Wrapper scripts are automatically created in the top-level build/ directory for easy access:
# Run from top-level build directory
# Note: For testing uninstalled, use the executables directly
./build/ollmchat.bin
./build/oc-test-cli --help
./build/oc-markdown-test
./build/oc-html2md
./build/oc-md2html
./build/oc-diff file1.txt file2.txt
./build/oc-vector-index --help
./build/oc-vector-search --help
./build/oc-test-fetch https://example.comThe wrapper scripts are automatically generated during the build process and set up the library paths correctly. Note that only ollmchat has a .bin wrapper; the other executables can be run directly from the build directory.
The project is organized into component directories, each with its own meson.build file:
Markdown Libraries:
libocmarkdown/- Markdown parsing and rendering (libocmarkdown.so, namespace:Markdown)libocmarkdowngtk/- Embeddable widget for rendering markdown using GtkTextView and GtkSourceView (libocmarkdowngtk.so, namespace:MarkdownGtk)
SQLite Library:
libocsqlite/- SQLite query builder (libocsqlite.so, namespace:SQ)
File Management Library (libocfiles.so):
libocfiles/- File and project management (libocfiles.so, namespace:OLLMfiles)- Provides file tracking and project management without GTK/git dependencies
- Used by
libocvectorfor file operations File.vala,FileBase.vala,FileAlias.vala,FileBuffer.vala,FileChange.vala- File classesFolder.vala,FolderFiles.vala- Folder classesProjectFile.vala,ProjectFiles.vala,ProjectList.vala,ProjectManager.vala,ProjectMigrate.vala- Project managementBufferProvider.vala,BufferProviderBase.vala,DummyFileBuffer.vala- Buffer providersGitProvider.vala,GitProviderBase.vala- Git provider classesDiff/- Diff and patch utilities (Differ.vala, Patch.vala, PatchApplier.vala)
Code Editor Library (liboccoder.so):
liboccoder/- Code editor and project management (liboccoder.so, namespace:OLLMcoder)SourceView.vala- Code editor component with syntax highlightingGtkSourceFileBuffer.vala- GTK SourceView buffer implementationBufferProvider.vala,GitProvider.vala- Buffer and git providers for GTK contextsSearchableDropdown.vala,ProjectDropdown.vala,FileDropdown.vala- Dropdown widgetsPrompt/CodeAssistant.vala- Code assistant agent with semantic search capabilities- The code assistant can perform semantic codebase search using the vector indexing system
- Includes an indexer tool (
oc-vector-index) for indexing codebases to enable semantic search - Semantic search allows finding code elements by meaning rather than just text matching
Vector Search Library (libocvector.so):
libocvector/- Semantic codebase search using vector embeddings and FAISS (libocvector.so, namespace:OLLMvector)- Status: Mostly complete - Provides semantic code search capabilities by indexing code elements (classes, methods, functions, etc.) using tree-sitter AST parsing, LLM analysis for descriptions, and FAISS for vector similarity search
Index.vala- FAISS vector index integrationDatabase.vala- Vector database with embeddings storageVectorMetadata.vala- Metadata storage (SQL database) mapping vector IDs to code locationsIndexing/- Code indexing components (namespace:OLLMvector.Indexing)Tree.vala- Tree-sitter AST parsing and code element extractionAnalysis.vala- LLM-based code analysis and description generationVectorBuilder.vala- Vector generation and FAISS storageIndexer.vala- Main indexing orchestrator for files and folders
Search/- Search components (namespace:OLLMvector.Search)Search.vala- Vector similarity search executionSearchResult.vala- Search result representation
Tool/- Tool integration (namespace:OLLMvector.Tool)CodebaseSearchTool.vala- Tool interface for semantic codebase searchRequestCodebaseSearch.vala- Request handling for codebase search tool
- Uses
libocfiles(OLLMfiles namespace) for file tracking and project management - Example tool:
oc-vector-index- Command-line tool for indexing files/folders - Tree-sitter Language Support: A script is available at
docs/tools/tree-sitter-packages.phpto generate Debian packages for tree-sitter language parsers. This script automates building Debian packages for various tree-sitter parsers from GitHub repositories, making it easy to install language support for the vector indexing system.
OLLMchat Base Library (libollmchat.so):
libollmchat/- Main namespace (OLLMchat)Client.vala- Main client class for Ollama/OpenAI API accessCall/- API call implementations (Chat, Embed, Generate, etc.)Response/- Response handling classesTool/- Tool interface and base classes (namespace:OLLMchat.Tool)ChatPermission/- Permission system for tool access control (namespace:OLLMchat.ChatPermission)Prompt/- Prompt generation system for different agent types with agent management (namespace:OLLMchat.Prompt)History/- Chat history management (namespace:OLLMchat.History)Message.vala,ChatContentInterface.vala,OllamaBase.vala- Core message and base classes
Tools Library (liboctools.so):
liboctools/- Tools for file operations and utilities (namespace:OLLMtools)ReadFile.vala,RequestReadFile.vala- File reading tool with line range supportEditMode.vala,RequestEditMode.vala,EditModeChange.vala- File editing toolRunCommand.vala,RequestRunCommand.vala- Terminal command execution toolWebFetchTool.vala,RequestWebFetch.vala- Web content fetching tool- Tools have access to
ProjectManagerfor project context awareness - Files in active project automatically skip permission prompts
OLLMchat GTK Library (libollmchatgtk.so):
libollmchatgtk/- GTK UI components (namespace:OLLMchatGtk)ChatWidget.vala- Main chat widgetChatView.vala- Chat view componentChatInput.vala- Chat input componentChatPermission.vala- Permission UI componentHistoryBrowser.vala- History browser componentMessage.vala,ClipboardManager.vala,ClipboardMetadata.vala- Supporting components
Main Application (ollmapp/):
ollmapp/- Main application directory (namespace:OLLMapp)Application.vala- Main application class (OLLMapp.OllmchatApplication)Window.vala- Main window class (OLLMapp.OllmchatWindow)SettingsDialog/- Settings dialog components (namespace:OLLMapp.SettingsDialog)MainDialog.vala- Main settings dialogConnectionsPage.vala- Connection management pageModelsPage.vala- Model management pageToolsPage.vala- Tool configuration pageRows/- Settings row widgets (namespace:OLLMapp.SettingsDialog.Rows)
- Note: The application uses
OLLMappnamespace to distinguish it from thelibollmchatlibrary which usesOLLMchatnamespace
Other Directories:
examples/- Example programs and test code (each with its own meson.build)docs/- Generated documentation (Valadoc) and implementation plansresources/- Resource files including prompt templatesvapi/- VAPI files for external dependencies
This project is licensed under the GNU Lesser General Public License version 3.0 (LGPL-3.0). See the LICENSE file for details.
- The build system uses Meson and Ninja with a modular structure
- Each library component has its own directory with its own
meson.buildfile - Resources are compiled into the binary using GLib's resource system
- The prompt system loads agent-specific sections from resource files
- Libraries are built as shared libraries with C headers, VAPI files, and GObject Introspection (GIR) files
- Markdown functionality is split into separate libraries (libocmarkdown and libocmarkdowngtk) for better modularity
- SQLite functionality is in a separate library (libocsqlite) for reuse
- Valadoc documentation is automatically generated in
docs/ollmchat/(unified documentation for all libraries) - Build order is managed automatically by Meson based on dependencies