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

Download of llm-ls does not work #10

Open
badbyte7 opened this issue Nov 9, 2023 · 4 comments
Open

Download of llm-ls does not work #10

badbyte7 opened this issue Nov 9, 2023 · 4 comments

Comments

@badbyte7
Copy link

badbyte7 commented Nov 9, 2023

Hi,

At first thank you very much about this great plugin. It is great to have the possibility to test LLMs out of the IDE. This is great stuff.

Unfortunately I have also an issue. At first I had some troubles to get a request out of the IDE until I recognised, that the llm-ls was missing. I am not sure, if the IDE proxy settings are respected for the download.

I managed it to download and install it by hand (Ubuntu 22.04).

Now when I enter the API access token with my own endpoint. The field is empty when I reopen the settings window. A header dump on the server does not show the bearer token either:

HTTP_HOST=XXX
SSL_TLS_SNI=XXX
CONTEXT_DOCUMENT_ROOT=/var/www/cgi-bin/
HTTPS=on
HTTP_USER_AGENT=llm-ls/0.4.0; rust/unknown; ide/JetBrains
SERVER_ADMIN=XXX
CONTEXT_PREFIX=/cgi-bin/
SERVER_PORT=443
SERVER_NAME=XXX
QUERY_STRING=
SCRIPT_FILENAME=/var/www/cgi-bin/postTest.sh
PWD=/var/www/cgi-bin
HTTP_ACCEPT=/
CONTENT_TYPE=application/json
REQUEST_METHOD=POST
SERVER_SIGNATURE=
SCRIPT_NAME=/cgi-bin/postTest.sh
REMOTE_PORT=54435
UNIQUE_ID=ZUyNoRkEkSDekapOW0nrsQAAAMw
DOCUMENT_ROOT=/var/www/html
SHLVL=1
SERVER_PROTOCOL=HTTP/1.1
REQUEST_URI=/cgi-bin/postTest.sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_ADDR=XXX
GATEWAY_INTERFACE=CGI/1.1
REQUEST_SCHEME=https
REMOTE_ADDR=XXX
CONTENT_LENGTH=259
SERVER_SOFTWARE=XXX
_=/usr/bin/env

Do you have any idea how this could happen, or do you need some further informations?

@McPatate
Copy link
Member

McPatate commented Nov 9, 2023

Hello @badbyte7, thanks for the feedback.

At first I had some troubles to get a request out of the IDE until I recognised, that the llm-ls was missing.

That's odd if you're on ubuntu, it should work out of the box. What CPU architecture are you using? Note that installing the plugin may require restarting the IDE, not sure the IDE notifies you to do so (maybe something I can configure somewhere as well).

The token disappears in the settings page because it's a secret and it isn't re-injected in the UI component (I didn't take the time to do that as I didn't feel it was useful, but maybe I should?). But it is stored in your secrets cache and should be used by your program. Do you apply / save the settings before exiting?

@badbyte7
Copy link
Author

badbyte7 commented Nov 9, 2023

Hi, thank you very much for the pretty fast feedback!

I am also not sure if I was prompted for a restart, but I tried a restart everytime, when something didn't work as I expected to go for sure ("Have you tried turning it of and on again" ;) ). I am pretty sure, that the proxy had something to do with the download, but up to now I didn't have time to retest it. I will let you know, if I know more.

I don't think, that it is necessary to show the whole token, but any indication, that there is a token stored could be helpful for some skeptical people like me. ;D

It's the same thing with the token. I've entered it, and pressed "OK" ("Apply" is always disabled). After that I tried the completion, but also after a restart the token is missing in the header.

@badbyte7
Copy link
Author

badbyte7 commented Nov 9, 2023

I've no reinstalled the plugin. In Ubuntu 22.04 (x86_64) there I had still no success. The llm-ls is not loaded, and I can't find anything usefull in the log.

Under Windows I get the following error message:

2023-11-09 15:37:15,982 [  24480]   WARN - #c.i.p.l.i.LspServerImpl - LlmLsLspServerDescriptor@Codellama-13b(RUNNING;0): Failed to start server
java.io.IOException: Cannot run program "gunzip": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at java.base/java.lang.Runtime.exec(Runtime.java:594)
	at java.base/java.lang.Runtime.exec(Runtime.java:418)
	at java.base/java.lang.Runtime.exec(Runtime.java:315)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.runCommand(LlmLsLspServerDescriptor.kt:98)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.downloadAndUnzip(LlmLsLspServerDescriptor.kt:91)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.downloadLlmLs(LlmLsLspServerDescriptor.kt:117)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptor.createCommandLine(LlmLsLspServerDescriptor.kt:20)
	at com.intellij.platform.lsp.api.LspServerDescriptor.startServerProcess(LspServerDescriptor.kt:93)
	at com.intellij.platform.lsp.impl.connector.Lsp4jServerConnectorStdio.<init>(Lsp4jServerConnectorStdio.java:19)
	at com.intellij.platform.lsp.impl.LspServerImpl.I(LspServerImpl.java:377)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:272)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 21 more

The error message is in german, and states that the sytem cannot find gunzip, because it is not installed by default. On my machine there is at least gzip installed. Maybe this call could be replaced by 'gzip --decompress'?

I've now installed gunzip, but now I stumbled over the next command:

2023-11-09 15:47:18,645 [  24788]   WARN - #c.i.p.l.i.LspServerImpl - LlmLsLspServerDescriptor@Codellama-13b(RUNNING;0): Failed to start server
java.io.IOException: Cannot run program "mv": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at java.base/java.lang.Runtime.exec(Runtime.java:594)
	at java.base/java.lang.Runtime.exec(Runtime.java:418)
	at java.base/java.lang.Runtime.exec(Runtime.java:315)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.runCommand(LlmLsLspServerDescriptor.kt:98)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.downloadAndUnzip(LlmLsLspServerDescriptor.kt:92)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptorKt.downloadLlmLs(LlmLsLspServerDescriptor.kt:117)
	at co.huggingface.llmintellij.lsp.LlmLsLspServerDescriptor.createCommandLine(LlmLsLspServerDescriptor.kt:20)
	at com.intellij.platform.lsp.api.LspServerDescriptor.startServerProcess(LspServerDescriptor.kt:93)
	at com.intellij.platform.lsp.impl.connector.Lsp4jServerConnectorStdio.<init>(Lsp4jServerConnectorStdio.java:19)
	at com.intellij.platform.lsp.impl.LspServerImpl.I(LspServerImpl.java:377)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:272)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
	at java.base/java.lang.ProcessImpl.create(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:499)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 21 more

@badbyte7
Copy link
Author

badbyte7 commented Nov 9, 2023

In this code passage there might be also the problem with the download in my Linux machine:

val downloadCommand = "curl -L -o $path.gz $url"

Because of our company proxy, the certificates are not known, and I've to use the insecure option with curl and other tools. The curl-command here does not know about these settings. It seems that I also have to set teh https_proxy environment variable to get this working under linux.

@badbyte7 badbyte7 changed the title No access token in HTTP Header Download of llm-ls does not work Nov 10, 2023
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

2 participants