chottolabs / kznllm.nvim

Apache License 2.0
33 stars 8 forks source link

Refactor v0.2 - hand over control to the user #14

Closed chottolabs closed 2 months ago

chottolabs commented 2 months ago

The various parameters each API provider expects can vary greatly (i.e. prompt caching in anthropic, min_p sampling methods in vllm, etc.).

I'm expecting the supported spec differences between API providers to diverge even further (especially when small local or self-hosted models get good eventually)

The key idea is to make it as easy as possible to retrieve data, pipe it straight into an API, and send the outputs somewhere in your nvim buffer without shooting yourself in the foot with the quirks of nvim.

Screenshot 2024-09-05 at 4 40 44 AM

after rewriting this plugin literally 5 times by now, it's now very clear that model + prompts + api spec + feature set are all very tightly coupled together. what I actually want for myself is a simple way to implement the whole stack of sub-components from scratch and package it together in a preset.

With this refactor, it's relatively easy to add entirely new features without touching the core of the plugin. (i.e. prompt caching, custom params, or fast + slow retrieval)

chottolabs commented 2 months ago
Vim(undojoin):E790: undojoin is not allowed after undo stack traceback

never have to see this mf again 🔫

chottolabs commented 2 months ago

+300 LOC from adding separate specs +100 LOC from the vllm chat template (it sucks and i need to fix it) +100 LOC from listing out all the presets

all in all, it's more concise and less messy to read now that all the state stuff is handled in presets.lua