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

[BUG] LocalAI Embeddings Node will not use API token #2115

Closed
eelco2k opened this issue Apr 6, 2024 · 4 comments
Closed

[BUG] LocalAI Embeddings Node will not use API token #2115

eelco2k opened this issue Apr 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@eelco2k
Copy link

eelco2k commented Apr 6, 2024

Describe the bug
When the LocalAI instance is configured with an Bearer API token. it is not possible to use the LocalAI Embeddings Node in flowiseAI.

It will not use the set API key from ChatLocalAI node.

To Reproduce

Add ChatLocalAI node add LocalAI credential. paste the API key from LocalAI. set correct basePath and model name.
Add "LocalAI Embeddings" node. set correct Base Path and ModelName.

Expected behavior
in HTTP POST request the full Authorization header with correct api key should be added. but only authorization: 'Bearer sk-' is added.

Screenshots / Debug code

OpenAI:DEBUG:request https://localai.base.url/v1/embeddings {
  method: 'post',
  path: '/embeddings',
�
{
    model: 'text-embedding-ada-002',
�
    input: [
      'data 1',
      'data 2',
    ]
  }
} {
  'content-length': '5512',
  accept: 'application/json',
  'content-type': 'application/json',
  'user-agent': 'OpenAI/JS 4.32.1',
  'x-stainless-lang': 'js',
  'x-stainless-package-version': '4.32.1',
  'x-stainless-os': 'Linux',
  'x-stainless-arch': 'x64',
  'x-stainless-runtime': 'node',
  'x-stainless-runtime-version': 'v18.20.0',
  authorization: 'Bearer sk-'
}
OpenAI:DEBUG:response (error; (error; not retryable)) 401 https://localai.base.url/v1/embeddings {
  connection: 'keep-alive',
  'content-length': '29',
  'content-type': 'application/json',
  date: 'Sat, 06 Apr 2024 22:00:39 GMT',
  server: 'nginx'
} undefined
2024-04-06 22:00:39 [ERROR]: 401 status code (no body)
Error: 401 status code (no body)
    at APIError.generate (/usr/local/lib/node_modules/flowise/node_modules/openai/error.js:47:20)
    at OpenAI.makeStatusError (/usr/local/lib/node_modules/flowise/node_modules/openai/core.js:263:33)
    at OpenAI.makeRequest (/usr/local/lib/node_modules/flowise/node_modules/openai/core.js:306:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /usr/local/lib/node_modules/flowise/node_modules/@langchain/openai/dist/embeddings.cjs:255:29
    at async RetryOperation._fn (/usr/local/lib/node_modules/flowise/node_modules/p-retry/index.js:50:12)
2024-04-06 22:00:39 [ERROR]: [server]: Error: Error: 401 status code (no body)
Error: Error: 401 status code (no body)
    at buildFlow (/usr/local/lib/node_modules/flowise/dist/utils/index.js:405:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async utilBuildChatflow (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:257:36)
    at async createInternalPrediction (/usr/local/lib/node_modules/flowise/dist/controllers/internal-predictions/index.js:7:29)

Setup

  • Flowise Version 1.6.3
  • OS: Docker, Linux
  • Browser Chrome
@HenryHengZJ
Copy link
Contributor

Is it for ChatLocalAI node or LocalAIEmbedding node?

@HenryHengZJ HenryHengZJ added the bug Something isn't working label Apr 7, 2024
@eelco2k
Copy link
Author

eelco2k commented Apr 7, 2024

It’s for LocalAIEmbedding node.

that node is missing the “api” credentials option in the node card.

@eelco2k
Copy link
Author

eelco2k commented Apr 8, 2024

Today i Added a new LocalAIEmbedding node and now the API credentials part is added to the node. I think it's fixed/added now then?

@HenryHengZJ
Copy link
Contributor

Today i Added a new LocalAIEmbedding node and now the API credentials part is added to the node. I think it's fixed/added now then?

Yeah it was added a while ago. The node on your canvas might be outdated. Glad that is now solved, closing for now.

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