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

config.json parameter "apiKey" does not be appear to be used with ollama provider #1262

Open
3 tasks done
troy256 opened this issue May 10, 2024 · 1 comment
Open
3 tasks done
Assignees
Labels
bug Something isn't working

Comments

@troy256
Copy link

troy256 commented May 10, 2024

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: v0.8.27
- IDE: VS Code

Description

We have Nginx doing SSL termination for ollama and forwarding to ollama_proxy_server for authentication, then to ollama. When trying to use Continue in VS Code with the following config.json block:

{
      "title": "llama3-instruct",
      "provider": "ollama",
      "model": "llama3:instruct",
      "completionOptions": {},
      "apiBase": "https://<my_endpoint>",
      "apiKey": "user1:<my_key>"
},

I get HTTP 403 Unauthorized error from Continue plugin. When analyzing the Nginx logs I see the requests coming in, but lacking any Bearer tokens:

image

Nginx logging config:
log_format headers '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request - $http_authorization';

To reproduce

No response

Log output

No response

@troy256 troy256 added the bug Something isn't working label May 10, 2024
@sestinj
Copy link
Contributor

sestinj commented May 13, 2024

@troy256 we hadn't been using apiKey for Ollama because it doesn't have built-in auth, but I can see why it would make sense to do that now: 034754c

The fix will be in the next release, but in the meantime you can use "requestOptions.headers" in config.json like this:

"models": [{
  "title": "Ollama",
  ...
  "requestOptions": { "headers": { "Authorization": "Bearer xxx" } }
  }]

@sestinj sestinj self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants