Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation request: Ollama + Helix from scratch #57

Open
alphastrata opened this issue Aug 10, 2024 · 9 comments
Open

Documentation request: Ollama + Helix from scratch #57

alphastrata opened this issue Aug 10, 2024 · 9 comments

Comments

@alphastrata
Copy link

So, the existing example/xyz.tomls aren't exactly easy to get going in the helix philosophy of 'batteries included".

I think we have two issues:

  1. Perhaps suggesting that users get started with a local .helix/languages.toml which if alongside their source will get merged with their system's languages.toml as defined by wherever they set the $HELIX_RUNTIME to. This will be especially problematic to debug as, whatever languge they choose to add lsp-ai to as an additional lsp will really blast their $HELIX_LOG (as it will at a minimum have multiple lsp's output in there)

  2. Having a bind setup for triggering autocomplete (or chat?) will involve them adding things to their regular config.toml, you cannot (at least on latest helix) make a keybinding in a languages.toml.

Perhaps it'd be worth (rather than providing dozens of snippets for supported models in json across the configuration in favour of one or two thorough examples that take users from soup to nuts.

As this is somewhat positioned as a copilot alternative, I worry that the project will miss out on a great deal of users and such as a result of the amount of understanding required to get this tol running.

Hope you keep it up, this is a great idea!

@SilasMarvin
Copy link
Owner

Thank you for your thoughts. This is not a problem I will be able to 100% solve myself. I appreciate that you value the project enough to share your ideas, and I agree with you on most points.

The current configuration guide is awful. For users to be successful they must be aware of and understand how language servers work, how to add them to their editor, and how to debug them. This is an unrealistic expectation.

You are right a good guide going from zero to in editor chatting / completion would be incredibly helpful. I will get this out.

I don’t think we can emulate helix’s batteries included methodology here. There are too many moving pieces, and to a certain extent, I don’t think it’s bad it requires some thought to configure as this a powerful useful tool for developers if used correctly.

What I want is to create a online configurator that asks a series of questions like:

  1. Do you want to enable in editor chatting (If so we ask what model, etc..)
  2. What editor are you using
  3. Do you want to enable inline-completion (if so we ask what model, etc…)

What do you think of an online configurator that not only outputs (in the case of helix) the languages.toml but explains what it does, how to use it, etc….? We can extend this to work for Neovim, and other popular text editors. I want to remove the barrier of having to read through the configuration section of the wiki unless they want to get into the weeds.

The logging is awful right now. I have a pr coming out this weekend (I think) that creates our own logging file which also includes all completion requests sent to llms in a nice user readable format. It’s a massive improvement. I’m still debating whether to make it the default log file, or if it should be a command line parameter that enables it. It will exist in the users cache directory (~/.cache on linux).

Once again thank you for your thoughts! It’s conversations like this that will make this project great.

@alphastrata
Copy link
Author

RE: A guide that produces a setup for you-- that'd be super neat.

Surely the simplest workflow is to push the LLM setup side of things onto something like Ollama no?

As they're working on a pretty simple:

  1. run this script
  2. ollama pull whatever model you like
  3. ollama serve whatever model you got
  4. underpants profit?

We can push the more difficult part entirely there in the short term, thereby alleviating the burden of documenting here.

If this is still going on in a few weeks now when I likely next get a chance to write some code I'll throw in a few PRs, but it looks like your project already has significant interest and someone else will likely pick it up.

@pierrelgol
Copy link

Hey sorry to drop by I don't know if this is the correct place to voice my problem, but I want to start by thanking you, your project looks amazing and as a hardcore helix-user I've been missing on LLM inside helix since they started to become popular, so I'm really excited to get your lsp-working. But currently I'm facing some issues and I'd be really great if someone could guide me or share his configuration for helix.

So currently I've installed codellama through this command :
curl -fsSL https://ollama.com/install.sh | sh

I've decided to use codellama 7b installed everything through the ollama CLI and I was able to run the model locally:
https://ollama.com/library/codellama

Next I've configured the lsp in my language.toml as follow

[language-server.lsp-ai]
command = "lsp-ai"

[language-server.lsp-ai.config.memory]
file_store = { }

[language-server.lsp-ai.config.models.model1]
type = "ollama"
model = "codellama:7b"

[language-server.lsp-ai.config.completion]
model = "model1"

[language-server.lsp-ai.config.completion.parameters]
max_context = "2000"

[language-server.lsp-ai.config.completion.parameters.option]
num_predicts = "32"

And I've added that configuration to my language

[[language]]
name = "c"
scope = "source.c"
file-types = ["c","h"]
roots = ["Makefile","run.sh","build.zig"]
block-comment-tokens = {start = "/*", end = "*/"}
indent = { tab-width = 8, unit = "\t" }
formatter = { command = "pipx run c_formatter_42", args = [""]}
diagnostic-severity = "error"
auto-format = true
language-servers = ["lsp-ai"]

So far so good everything seems about what I would expect from adding an lsp into language.toml appart from the bit of extra configuration. Now I think I must be missing a step because the lsp crashes and fails to complete anything. I've tried a bunch of different tweaks but maybe I'm missing something really obvious or maybe the model can't work with this configuration. I've tried to debug with the log_file and even exported the RUST_BACKTRACE=1 to get more information but all I get when attempting to get a completion request which with my current config is C-x is this error :

2024-08-21T17:58:45.908 helix_lsp::transport [ERROR] Could not close request on a closed channel (id=Num(1))
2024-08-21T17:58:45.908 helix_lsp::transport [ERROR] Could not close request on a closed channel (id=Num(2))
2024-08-21T17:58:45.908 helix_lsp::transport [ERROR] lsp-ai err: <- StreamClosed
2024-08-21T17:58:45.908 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server

Caused by:
    channel closed

Stack backtrace:
   0: helix_lsp::transport::Transport::process_server_message::{{closure}}
   1: helix_lsp::transport::Transport::recv::{{closure}}
   2: tokio::runtime::task::core::Core<T,S>::poll
   3: tokio::runtime::task::harness::Harness<T,S>::poll
   4: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
   5: tokio::runtime::scheduler::multi_thread::worker::Context::run
   6: tokio::runtime::context::scoped::Scoped<T>::set
   7: tokio::runtime::context::runtime::enter_runtime
   8: tokio::runtime::scheduler::multi_thread::worker::run
   9: tokio::runtime::task::core::Core<T,S>::poll
  10: tokio::runtime::task::harness::Harness<T,S>::poll
  11: tokio::runtime::blocking::pool::Inner::run
  12: std::sys_common::backtrace::__rust_begin_short_backtrace
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
  14: std::sys::pal::unix::thread::Thread::new::thread_start
  15: start_thread
             at ./nptl/pthread_create.c:447:8
  16: __GI___clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78)

So if you have any solution I'd be glad to hear it, just for information I'm on Ubuntu 24.04, and I'm using helix 24.7 (0a4432b1)

@SilasMarvin
Copy link
Owner

I'm glad you like it! Don't apologize the documentation is kind of rough right now, I'm happy to help.

Can you set the env variable LSP_AI_LOG to DEBUG

export LSP_AI_LOG=DEBUG

And then share your helix logs?

@pierrelgol
Copy link

Yes of course this is what I get


2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- " INFO lsp_ai: lsp-ai logger initialized starting server\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::msg: < {\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"capabilities\":{\"general\":{\"positionEncodings\":[\"utf-8\",\"utf-32\",\"utf-16\"]},\"textDocument\":{\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}},\"dataSupport\":true,\"disabledSupport\":true,\"isPreferredSupport\":true,\"resolveSupport\":{\"properties\":[\"edit\",\"command\"]}},\"completion\":{\"completionItem\":{\"deprecatedSupport\":true,\"insertReplaceSupport\":true,\"resolveSupport\":{\"properties\":[\"documentation\",\"detail\",\"additionalTextEdits\"]},\"snippetSupport\":true,\"tagSupport\":{\"valueSet\":[1]}},\"completionItemKind\":{}},\"formatting\":{\"dynamicRegistration\":false},\"hover\":{\"contentFormat\":[\"markdown\"]},\"inlayHint\":{\"dynamicRegistration\":false},\"publishDiagnostics\":{\"tagSupport\":{\"valueSet\":[1,2]},\"versionSupport\":true},\"rename\":{\"dynamicRegistration\":false,\"honorsChangeAnnotations\":false,\"prepareSupport\":true},\"signatureHelp\":{\"signatureInformation\":{\"activeParameterSupport\":true,\"documentationFormat\":[\"markdown\"],\"parameterInformation\":{\"labelOffsetSupport\":true}}}},\"window\":{\"workDoneProgress\":true},\"workspace\":{\"applyEdit\":true,\"configuration\":true,\"didChangeConfiguration\":{\"dynamicRegistration\":false},\"didChangeWatchedFiles\":{\"dynamicRegistration\":true,\"relativePatternSupport\":false},\"executeCommand\":{\"dynamicRegistration\":false},\"fileOperations\":{\"didRename\":true,\"willRename\":true},\"inlayHint\":{\"refreshSupport\":false},\"symbol\":{\"dynamicRegistration\":false},\"workspaceEdit\":{\"documentChanges\":true,\"failureHandling\":\"abort\",\"normalizesLineEndings\":false,\"resourceOperations\":[\"create\",\"rename\",\"delete\"]},\"workspaceFolders\":true}},\"clientInfo\":{\"name\":\"helix\",\"version\":\"24.7 (0a4432b1)\"},\"initializationOptions\":{\"completion\":{\"model\":\"model1\",\"parameters\":{\"max_context\":\"2000\",\"option\":{\"num_predicts\":\"32\"}}},\"memory\":{\"file_store\":{}},\"models\":{\"model1\":{\"model\":\"codellama:7b\",\"type\":\"ollama\"}}},\"processId\":198399,\"rootPath\":\"/home/pollivie/workspace/school/archive/dev\",\"rootUri\":\"file:///home/pollivie/workspace/school/archive/dev\",\"workspaceFolders\":[{\"name\":\"dev\",\"uri\":\"file:///home/pollivie/workspace/school/archive/dev\"}]},\"id\":0}    \n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::stdio: sending message Request(\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "    Request {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "        id: RequestId(\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            I32(\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                0,\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            ),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "        ),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "        method: \"initialize\",\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "        params: Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"capabilities\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"general\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"positionEncodings\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        String(\"utf-8\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        String(\"utf-32\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        String(\"utf-16\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"textDocument\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"codeAction\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"codeActionLiteralSupport\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"codeActionKind\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                \"valueSet\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"quickfix\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"refactor\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"refactor.extract\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"refactor.inline\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"refactor.rewrite\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"source\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"source.organizeImports\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dataSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"disabledSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"isPreferredSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"resolveSupport\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"properties\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                String(\"edit\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                String(\"command\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"completion\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"completionItem\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"deprecatedSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"insertReplaceSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"resolveSupport\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                \"properties\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"documentation\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"detail\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    String(\"additionalTextEdits\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"snippetSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"tagSupport\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                \"valueSet\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                    Number(1),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"completionItemKind\": Object {},\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"formatting\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"hover\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"contentFormat\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            String(\"markdown\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"inlayHint\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"publishDiagnostics\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"tagSupport\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"valueSet\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                Number(1),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                Number(2),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"versionSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"rename\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"honorsChangeAnnotations\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"prepareSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"signatureHelp\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"signatureInformation\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"activeParameterSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"documentationFormat\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                String(\"markdown\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"parameterInformation\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                                \"labelOffsetSupport\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"window\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"workDoneProgress\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"workspace\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"applyEdit\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"configuration\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"didChangeConfiguration\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"didChangeWatchedFiles\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"relativePatternSupport\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"executeCommand\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"fileOperations\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"didRename\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"willRename\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"inlayHint\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"refreshSupport\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"symbol\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"dynamicRegistration\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"workspaceEdit\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"documentChanges\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"failureHandling\": String(\"abort\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"normalizesLineEndings\": Bool(false),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"resourceOperations\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            String(\"create\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            String(\"rename\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            String(\"delete\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"workspaceFolders\": Bool(true),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"clientInfo\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"name\": String(\"helix\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"version\": String(\"24.7 (0a4432b1)\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"initializationOptions\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"completion\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"model\": String(\"model1\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"parameters\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"max_context\": String(\"2000\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"option\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"num_predicts\": String(\"32\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"memory\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"file_store\": Object {},\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                \"models\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"model1\": Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"model\": String(\"codellama:7b\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"type\": String(\"ollama\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"processId\": Number(198399),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"rootPath\": String(\"/home/pollivie/workspace/school/archive/dev\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"rootUri\": String(\"file:///home/pollivie/workspace/school/archive/dev\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            \"workspaceFolders\": Array [\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                Object {\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"name\": String(\"dev\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"uri\": String(\"file:///home/pollivie/workspace/school/archive/dev\"),\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "            ],\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "        },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "    },\n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- ")    \n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::msg: > {\"jsonrpc\":\"2.0\",\"id\":0,\"result\":{\"capabilities\":{\"codeActionProvider\":{\"resolveProvider\":true},\"completionProvider\":{},\"textDocumentSync\":2}}}    \n"
2024-08-21T18:24:24.839 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::msg: < {\"jsonrpc\":\"2.0\",\"method\":\"initialized\",\"params\":{}}    \n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::stdio: sending message Notification(\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    Notification {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        method: \"initialized\",\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        params: Object {},\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- ")    \n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::msg: < {\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":{\"completion\":{\"model\":\"model1\",\"parameters\":{\"max_context\":\"2000\",\"option\":{\"num_predicts\":\"32\"}}},\"memory\":{\"file_store\":{}},\"models\":{\"model1\":{\"model\":\"codellama:7b\",\"type\":\"ollama\"}}}}}    \n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::stdio: sending message Notification(\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    Notification {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        method: \"workspace/didChangeConfiguration\",\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        params: Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "            \"settings\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"completion\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"model\": String(\"model1\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"parameters\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"max_context\": String(\"2000\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"option\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                            \"num_predicts\": String(\"32\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                        },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"memory\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"file_store\": Object {},\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"models\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    \"model1\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"model\": String(\"codellama:7b\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                        \"type\": String(\"ollama\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                    },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "            },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- ")    \n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::msg: < {\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didOpen\",\"params\":{\"textDocument\":{\"languageId\":\"c\",\"text\":\"/* ************************************************************************** */\\n/*                                                                            */\\n/*                                                        :::      ::::::::   */\\n/*   main.c                                             :+:      :+:    :+:   */\\n/*                                                    +:+ +:+         +:+     */\\n/*   By: pollivie <pollivie.student.42.fr>          +#+  +:+       +#+        */\\n/*                                                +#+#+#+#+#+   +#+           */\\n/*   Created: 2024/07/21 17:50:48 by pollivie          #+#    #+#             */\\n/*   Updated: 2024/07/21 17:50:49 by pollivie         ###   ########.fr       */\\n/*                                                                            */\\n/* ************************************************************************** */\\n\\n#include \\\"slib/include/slib.h\\\"\\n\\nint add(int a, int b){\\n\\treturn (a + b);\\n\\n}\\n\\nint\\tmain(void)\\n{\\n\\tt_smlx_instance *mlx;\\n\\n\\tmlx = smlx_create_instance(720, 1280, \\\"HI\\\");\\n\\tsmlx_clear(mlx, 0x00FF0000);\\n\\tsleep(1);\\n\\tif (mlx)\\n\\t\\tsmlx_destroy_instance(mlx);\\n\\t\\n\\treturn (0);\\n}\\n\",\"uri\":\"file:///home/pollivie/workspace/school/archive/dev/main.c\",\"version\":0}}}    \n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "DEBUG lsp_server::stdio: sending message Notification(\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    Notification {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        method: \"textDocument/didOpen\",\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        params: Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "            \"textDocument\": Object {\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"languageId\": String(\"c\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"text\": String(\"/* ************************************************************************** */\\n/*                                                                            */\\n/*                                                        :::      ::::::::   */\\n/*   main.c                                             :+:      :+:    :+:   */\\n/*                                                    +:+ +:+         +:+     */\\n/*   By: pollivie <pollivie.student.42.fr>          +#+  +:+       +#+        */\\n/*                                                +#+#+#+#+#+   +#+           */\\n/*   Created: 2024/07/21 17:50:48 by pollivie          #+#    #+#             */\\n/*   Updated: 2024/07/21 17:50:49 by pollivie         ###   ########.fr       */\\n/*                                                                            */\\n/* ************************************************************************** */\\n\\n#include \\\"slib/include/slib.h\\\"\\n\\nint add(int a, int b){\\n\\treturn (a + b);\\n\\n}\\n\\nint\\tmain(void)\\n{\\n\\tt_smlx_instance *mlx;\\n\\n\\tmlx = smlx_create_instance(720, 1280, \\\"HI\\\");\\n\\tsmlx_clear(mlx, 0x00FF0000);\\n\\tsleep(1);\\n\\tif (mlx)\\n\\t\\tsmlx_destroy_instance(mlx);\\n\\t\\n\\treturn (0);\\n}\\n\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"uri\": String(\"file:///home/pollivie/workspace/school/archive/dev/main.c\"),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "                \"version\": Number(0),\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "            },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "        },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- "    },\n"
2024-08-21T18:24:24.840 helix_lsp::transport [ERROR] lsp-ai err <- ")    \n"

@SilasMarvin
Copy link
Owner

I don't see any errors in the logs. Can you type in your editor? Use it until you would expect to see a completion and share those logs.

@pierrelgol
Copy link

pierrelgol commented Aug 22, 2024

helix.log
I've used it to code for 5 minutes on a C++ project and I had multiple expectation of completion but nothing happened, maybe I'm doing something wrong but really nothing happens when I press my usual keybindings for completion. Maybe I'm not doing things correctly I'm not sure. thanks for taking time to look at this 👍🏽

@SilasMarvin
Copy link
Owner

I just tested your configuration on my computer and it is working fine for me.

Your logs show a bunch of completion requests to the language server and we can see the language server calling out to ollama:

2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- " INFO dispatch_request{request=Completion(CompletionRequest { id: RequestId(I32(1)), params: CompletionParams { text_document_position: TextDocumentPositionParams { text_document: TextDocumentIdentifier { uri: Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/home/pollivie/workspace/school/CPP-42/CPP03/ex00/ClapTrap.cpp\", query: None, fragment: None } }, position: Position { line: 71, character: 4 } }, work_done_progress_params: WorkDoneProgressParams { work_done_token: None }, partial_result_params: PartialResultParams { partial_result_token: None }, context: Some(CompletionContext { trigger_kind: Invoked, trigger_character: None }) } })}:do_generate{prompt=ContextAndCode(ContextAndCodePrompt { context: \"\", code: \"/* ************************************************************************** */\\n/*                                                                            */\\n/*                                                        :::      ::::::::   */\\n/*   ClapTrap.cpp                                       :+:      :+:    :+:   */\\n/*                                                    +:+ +:+         +:+     */\\n/*   By: pollivie <pollivie.student.42.fr>          +#+  +:+       +#+        */\\n/*                                                +#+#+#+#+#+   +#+           */\\n/*   Created: 2024/08/21 13:30:54 by pollivie          #+#    #+#             */\\n/*   Updated: 2024/08/21 13:30:54 by pollivie         ###   ########.fr       */\\n/*                                                                            */\\n/* ************************************************************************** */\\n\\n#include \\\"ClapTrap.hpp\\\"\\n\\nClapTrap::ClapTrap() {\\n}\\n\\nClapTrap::ClapTrap(std::string name, unsigned int hit_points, unsigned int energy_points, unsigned int attack_damage)\\n    : _name(name), _hit_points(hit_points), _energy_points(energy_points), _attack_damage(attack_damage) {\\n}\\n\\nClapTrap::ClapTrap(ClapTrap const &other) {\\n\\t*this = other;\\n}\\n\\nClapTrap &ClapTrap::operator=(const ClapTrap &other) {\\n\\tif (this != &other) {\\n\\t\\tthis->_name = other._name;\\n\\t\\tthis->_hit_points = other._hit_points;\\n\\t\\tthis->_energy_points = other._energy_points;\\n\\t\\tthis->_attack_damage = other._attack_damage;\\n\\t}\\n\\treturn (*this);\\n}\\n\\nbool ClapTrap::isAlive(void) const {\\n\\treturn (_hit_points != 0);\\n}\\n\\nbool ClapTrap::hasEnoughEnergy(void) const {\\n\\treturn (_energy_points != 0);\\n}\\n\\nvoid ClapTrap::attack(const std::string &target) {\\n\\tstd::cout << \\\"ClapTrap \\\" << _name;\\n\\tif (!isAlive()) {\\n\\t\\tstd::cout << \\\", can't attack because he is dead\\\";\\n\\t} else if (hasEnoughEnergy()) {\\n\\t\\tstd::cout << \\\" attacks \\\" << target << \\\", causing \\\" << _attack_damage << \\\" points of damage!\\\";\\n\\t\\t_energy_points -= 1;\\n\\t} else {\\n\\t\\tstd::cout << \\\", can't attack because he lacks energy\\\";\\n\\t}\\n\\tstd::cout << std::endl;\\n}\\n\\nvoid ClapTrap::takeDamage(const unsigned int amount) {\\n\\tstd::cout << \\\"ClapTrap \\\" << _name;\\n\\tif (!isAlive()) {\\n\\t\\tstd::cout << \\\" can't be attacked because he is dead\\\" << std::endl;\\n\\t} else if (amount >= _hit_points) {\\n\\t\\t_hit_points = 0;\\n\\t\\tstd::cout << \\\" took \\\" << amount << \\\" of damage\\\";\\n\\t\\tstd::cout << \\\" and is now dead\\\" << std::endl;\\n\\t} else {\\n\\t\\t_hit_points -= amount;\\n\\t\\tstd::cout << \\\" took \\\" << amount << \\\" of damage\\\";\\n\\t\\tstd::cout << \\\" and is now left with\\\" << _hit_points << \\\" points of health\\\" << std::endl;\\n\\t}\\n}\\n\\nvoid\", selected_text: None }) params=Object {\"max_context\": String(\"2000\"), \"option\": Object {\"num_predicts\": String(\"32\")}}}: lsp_ai::transformer_backends::ollama: Calling Ollama compatible completions API with parameters:\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "{\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"keep_alive\": null,\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"model\": \"codellama:7b\",\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"options\": {},\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"prompt\": \"\\n\\n/* ************************************************************************** */\\n/*                                                                            */\\n/*                                                        :::      ::::::::   */\\n/*   ClapTrap.cpp                                       :+:      :+:    :+:   */\\n/*                                                    +:+ +:+         +:+     */\\n/*   By: pollivie <pollivie.student.42.fr>          +#+  +:+       +#+        */\\n/*                                                +#+#+#+#+#+   +#+           */\\n/*   Created: 2024/08/21 13:30:54 by pollivie          #+#    #+#             */\\n/*   Updated: 2024/08/21 13:30:54 by pollivie         ###   ########.fr       */\\n/*                                                                            */\\n/* ************************************************************************** */\\n\\n#include \\\"ClapTrap.hpp\\\"\\n\\nClapTrap::ClapTrap() {\\n}\\n\\nClapTrap::ClapTrap(std::string name, unsigned int hit_points, unsigned int energy_points, unsigned int attack_damage)\\n    : _name(name), _hit_points(hit_points), _energy_points(energy_points), _attack_damage(attack_damage) {\\n}\\n\\nClapTrap::ClapTrap(ClapTrap const &other) {\\n\\t*this = other;\\n}\\n\\nClapTrap &ClapTrap::operator=(const ClapTrap &other) {\\n\\tif (this != &other) {\\n\\t\\tthis->_name = other._name;\\n\\t\\tthis->_hit_points = other._hit_points;\\n\\t\\tthis->_energy_points = other._energy_points;\\n\\t\\tthis->_attack_damage = other._attack_damage;\\n\\t}\\n\\treturn (*this);\\n}\\n\\nbool ClapTrap::isAlive(void) const {\\n\\treturn (_hit_points != 0);\\n}\\n\\nbool ClapTrap::hasEnoughEnergy(void) const {\\n\\treturn (_energy_points != 0);\\n}\\n\\nvoid ClapTrap::attack(const std::string &target) {\\n\\tstd::cout << \\\"ClapTrap \\\" << _name;\\n\\tif (!isAlive()) {\\n\\t\\tstd::cout << \\\", can't attack because he is dead\\\";\\n\\t} else if (hasEnoughEnergy()) {\\n\\t\\tstd::cout << \\\" attacks \\\" << target << \\\", causing \\\" << _attack_damage << \\\" points of damage!\\\";\\n\\t\\t_energy_points -= 1;\\n\\t} else {\\n\\t\\tstd::cout << \\\", can't attack because he lacks energy\\\";\\n\\t}\\n\\tstd::cout << std::endl;\\n}\\n\\nvoid ClapTrap::takeDamage(const unsigned int amount) {\\n\\tstd::cout << \\\"ClapTrap \\\" << _name;\\n\\tif (!isAlive()) {\\n\\t\\tstd::cout << \\\" can't be attacked because he is dead\\\" << std::endl;\\n\\t} else if (amount >= _hit_points) {\\n\\t\\t_hit_points = 0;\\n\\t\\tstd::cout << \\\" took \\\" << amount << \\\" of damage\\\";\\n\\t\\tstd::cout << \\\" and is now dead\\\" << std::endl;\\n\\t} else {\\n\\t\\t_hit_points -= amount;\\n\\t\\tstd::cout << \\\" took \\\" << amount << \\\" of damage\\\";\\n\\t\\tstd::cout << \\\" and is now left with\\\" << _hit_points << \\\" points of health\\\" << std::endl;\\n\\t}\\n}\\n\\nvoid\",\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"raw\": true,\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "  \"stream\": false\n"
2024-08-22T11:07:11.218 helix_lsp::transport [ERROR] lsp-ai err <- "}\n"

What are you typing in your file? Is your file just a ton of asterisks?

The weird thing is I am not seeing any responses from ollama. Have you tested that you can run codellama:7b locally?

Also make sure to upgrade to the latest version of lsp-ai if you have not:

cargo install lsp-ai

As it has some better logging features.

@pierrelgol
Copy link

Oh I've figured it out, I use a school header everywhere in my projects and I think that must confuse the model response or making it a lot slower than it should be, I'm not used to completion taking this long but I guess this make sense on my hardware I only have an rx6700s. So not a top of the line NVIDIA gpu. So I just need to wait for 10s and I actually get a suggestion. Sorry that I bothered you with my logs and thanks for taking the time, I think I'm going to try different models and see if one is snappy enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants