Replies: 3 comments 3 replies
-
|
Appreciate you reading the CONTRIBUTING file. My advice is to share it in these discussions first. If it gains traction then I can consider including it in the plugin in the future. |
Beta Was this translation helpful? Give feedback.
1 reply
-
return {
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("codecompanion").setup({
adapters = {
nvidia_nim = function()
local openai = require("codecompanion.adapters.openai")
return {
name = "nvidia_nim",
formatted_name = "Nvidia NIM",
url = "https://integrate.api.nvidia.com/v1/chat/completions",
env = {
api_key = "NVIDIA-API-KEY"
},
headers = {
["Content-Type"] = "application/json",
["Authorization"] = "Bearer ${api_key}",
},
parameters = {
sync = true
},
handlers = {
setup = function(self)
if self.opts and self.opts.stream then
self.parameters.stream = true
end
return true
end,
tokens = function(self, data)
return openai.handlers.tokens(self, data)
end,
form_parameters = function(self, params, messages)
return openai.handlers.form_parameters(self, params, messages)
end,
form_messages = function(self, messages)
return openai.handlers.form_messages(self, messages)
end,
chat_output = function(self, data)
return openai.handlers.chat_output(self, data)
end,
inline_output = function(self, data, context)
return openai.handlers.inline_output(self, data, context)
end,
on_exit = function(self, data)
return openai.handlers.on_exit(self, data)
end,
},
schema = {
model = {
order = 1,
mapping = "parameters",
type = "enum",
desc = "ID of the model to use",
default = "meta/llama-3-70b-instruct",
choices = {
["nvidia/nemotron-3-nano-30b-a3b"] = { opts = { can_reason = true } },
["meta/llama-3-70b-instruct"] = { opts = { can_reason = true } },
["z-ai/glm4.7"] = { opts = { can_reason = true } },
},
},
max_tokens = {
mapping = "parameters",
default = 16384,
},
},
}
end,
},
strategies = {
chat = {
adapter = "nvidia_nim",
},
inline = {
adapter = "nvidia_nim",
},
},
})
end,
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Not work with new version |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I built and nvidia nim adapter, I don't know if it is worth it for a PR. I just read the CONTRIBUTIONS.md and it recommends I asked here first.
Beta Was this translation helpful? Give feedback.
All reactions