ollama-holes-plugin: A typed-hole plugin that uses LLMs to generate valid hole-fits
This package provides a GHC plugin that uses LLMs to generate valid hole-fits. It supports multiple backends including Ollama, OpenAI, and Gemini.
The following flags are available:
To specify the model to use:
-fplugin-opt=GHC.Plugin.OllamaHoles:model=<model_name>
To include documentation in the LLM's context (not recommended for small models):
-fplugin-opt=GHC.Plugin.OllamaHoles:include-docs
To specify the backend to use (ollama, openai, or gemini):
-fplugin-opt=GHC.Plugin.OllamaHoles:backend=<backend_name>
When using the openai backend, you can specify a custom base_url, e.g.
-fplugin-opt=GHC.Plugin.OllamaHoles:openai_base_url=api.groq.com/api
You can also specify which key to use.
-fplugin-opt=GHC.Plugin.OllamaHoles:openai_key_name=GROQ_API_KEY
To specify how many fits to generate (passed to the model)
-fplugin-opt=GHC.Plugin.OllamaHoles:n=5
To enable debug output:
-fplugin-opt=GHC.Plugin.OllamaHoles:debug
For custom model options:
-fplugin-opt=GHC.Plugin.OllamaHoles:model-options=<json>
Where json is an object with your parameters, e.g.:
-fplugin-opt=GHC.Plugin.OllamaHoles:model-options={"num_ctxt": 32000, "temperature": 1.0}
For the Ollama backend, make sure you have the Ollama CLI installed and the model you want to use is available. You can install the Ollama CLI by following the instructions at https://ollama.com/download, and you can install the default model (qwen3) by running `ollama pull qwen3`.
For the OpenAI backend, you'll need to set the OPENAI_API_KEY
environment variable with your API key.
For the Gemini backend, you'll need to set the GEMINI_API_KEY
environment variable with your API key.
Note that the speed and quality of the hole-fits generated by the plugin depends on
the model you use, and the default model requires a GPU to run efficiently.
For a smaller model, we suggest `gemma3:4b-it-qat`, `phi4-mini-reasoning` or `deepcoder:1.5b`,
or one of the smaller qwen3
models, such as `qwen3:1.7b` or `qwen3:4b` or even `qwen3:0.6b`,
though results may vary.
[Skip to Readme]
Downloads
- ollama-holes-plugin-0.1.6.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.4.0, 0.1.5.0, 0.1.5.1, 0.1.5.2, 0.1.5.3, 0.1.6.0 |
---|---|
Change log | CHANGELOG.md |
Dependencies | aeson (>=2.2 && <2.3), base (>=4.18 && <4.22), containers (>=0.6 && <0.8), ghc (>=9.6 && <9.14), modern-uri (>=0.3 && <0.4), ollama-haskell (>=0.1 && <0.2), req (>=3.13 && <3.14), text (>=2.1 && <2.2) [details] |
Tested with | ghc >=9.6 && <9.7, ghc >=9.8 && <9.9, ghc >=9.10 && <9.11, ghc >=9.12 && <9.13 |
License | MIT |
Copyright | 2025 (c) Matthias Pall Gissurarson |
Author | Matthias Pall Gissurarson <mpg@mpg.is> |
Maintainer | Matthias Pall Gissurarson <mpg@mpg.is> |
Category | Development, Compiler Plugin |
Home page | https://github.com/Tritlo/OllamaHoles |
Source repo | head: git clone git://github.com/Tritlo/OllamaHoles.git |
Uploaded | by tritlo at 2025-05-02T12:50:17Z |
Distributions | |
Downloads | 10 total (10 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |