tzachar / cmp-ai Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi is there any chance for llama integration? Maybe by using ollama locar REST api:
https://github.com/jmorganca/ollama/blob/main/docs/api.md#request
I wish user could define delay e.g. 0.3 sec, where cmp-ai would wait for user to be idle for 0.3 before sending request to server.
I think right now it fires autocomplete on every stroke, right?
I know about [C-x] mapping, but still having delay option would be cool - it would prevent my GPU fans from spining when typing fast, and not waiting for autocomplete.
Awesome project!
I am searching for an AWS code whisperer plugin and found this project. I guess this would be the best place to insert a new AI tool.
Currently, I'm using ollama on a docker container. I want to specify the IP and port. Thanks for the plugin btw.
I think something is wrong with arguments passed to ollama:new
the o
variable seems to hold 'provider_options' (initialized by user - to override build in model) :
params is nill.
Thus build-in parameters cannot be overridden in line:
self.params = vim.tbl_deep_extend('keep', params or {}, {
Config:
local cmp_ai = require "cmp_ai.config"
cmp_ai:setup {
max_lines = 20,
provider = "Ollama",
provider_options = {
model = 'deepseek-coder:1.3b-base-q5_0', -- way stronger version.. but not working..--need custom promps.
-- prompt="<|fim▁begin|>"..lines_before.."<|fim▁hole|>"..lines_after.."<|fim▁end|>"
options = {
temperature = 0.2,
}
},
.......
Btw. is there way to override model promp from within 'provider_options' ?
Hi there, I'm getting the "Completion started" notification in each keystroke, but the suggestion does not show up at all.
All other completion cmp
plugins are working fine, even tabnine.
My OPENAI_API_KEY key is set and working.
Please let me know what is missing:
local cmp_ai = require("cmp_ai.config")
local ai_compare = require("cmp_ai.compare")
...
-- Cmp AI config
cmp_ai:setup({
max_lines = 1000,
provider = "OpenAI",
model = "gpt-4",
notify = true,
run_on_every_keystroke = true,
ignored_file_types = {
-- default is not to ignore
-- uncomment to ignore in lua:
-- lua = true
},
})
sources = cmp.config.sources({
{ name = "cmp_ai" },
...
-- Set source name
vim_item.menu = ({
cmp_ai = "[CMP_AI ]",
....
-- AI custom symbol and type
if entry.source.name == ("cmp_tabnine" or "cmp_ai") then
local detail = (entry.completion_item.labelDetails or {}).detail
vim_item.kind = ""
if detail and detail:find(".*%%.*") then
vim_item.kind = vim_item.kind .. " " .. detail
end
if (entry.completion_item.data or {}).multiline then
vim_item.menu = "[AI - ML]"
end
end
local maxwidth = 80
vim_item.abbr = string.sub(vim_item.abbr, 1, maxwidth)
return vim_item
end,
....
sorting = {
priority_weight = 2,
comparators = {
ai_compare,
I'm trying to use the Bard
backend with cmp-ai
but I'm getting the error in the screenshot below.
Just to make sure it's not a problem with my Bard
API installation, I can successfully call the Bard
API from a Python REPL
as you can see in the screenshot below.
The culprit seems to be json.choices
returning nil
instead of a table on line 83
in the bard backend.
Let me know if you need me to provide further details.
the path to python is hard-coded to your local version
command = '/home/tzachar/.pyenv/shims/python',
https://github.com/tzachar/cmp-ai/blob/main/lua/cmp_ai/backends/bard.lua#L71
As title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.