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] #5495

Open
thunderbug1 opened this issue Jan 17, 2025 · 4 comments
Open

[Bug] #5495

thunderbug1 opened this issue Jan 17, 2025 · 4 comments
Labels
azure 🐛 Bug Something isn't working | 缺陷

Comments

@thunderbug1
Copy link

📦 Environment

Docker

📌 Version

v1.46.4

💻 Operating System

Windows

🌐 Browser

Chrome

🐛 Bug Description

I tried to configure the used embedding model to use my own azure-openai endpoint but I get an error.
I could not find any documentation about how to configure the custom embedding model and tried to do it based on the recent closed pull request.

In my region embedding-text-3-small is not available, so I am using embedding-text-3-large.

These are the relevant env variable settings:


AZURE_API_KEY=${OPENAI_API_KEY}
AZURE_ENDPOINT=https://myapi.openai.azure.com/
AZURE_API_VERSION=2024-08-01-preview
AZURE_MODEL_LIST=+gpt-4o<128000:fc:vision:file>,+gpt-4o-mini<128000:fc:vision:file>
DEFAULT_FILES_CONFIG=embedding_model=azure/embedding-text-3-large,reranker_model=azure/Cohere-rerank-v3-multilingual-wz,query_model=full_text

AZURE_OPENAI_ENDPOINT=${AZURE_ENDPOINT}
AZURE_OPENAI_MODEL_MAPPER=gpt-3.5-turbo=gpt-35-turbo,gpt-4=gpt-4-turbo,text-embedding-3-small=text-embedding-3-large
AZURE_OPENAI_API_VER=${AZURE_API_VERSION}

This is the error I get:

embeddingChunks error { message: '{}', name: 'EmbeddingError' }

📷 Recurrence Steps

Setup lobe chat with docker compose and configure it with an env file with the settings from above.

🚦 Expected Behavior

The document embeddings should be calculated successfully.

📝 Additional Information

These are the console logs:

[+] Running 5/5
✔ Container lobe-network Created 0.0s
✔ Container lobe-minio Created 0.0s
✔ Container lobe-postgres Created 0.0s
✔ Container lobe-casdoor Created 0.0s
✔ Container lobe-chat Recreated 0.1s
Attaching to lobe-casdoor, lobe-chat, lobe-minio, lobe-network, lobe-postgres
lobe-minio | MinIO Object Storage Server
lobe-minio | Copyright: 2015-2025 MinIO, Inc.
lobe-minio | License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
lobe-minio | Version: RELEASE.2024-12-13T22-19-12Z (go1.23.4 linux/amd64)
lobe-minio |
lobe-minio | API: http://172.18.0.3:9000 http://127.0.0.1:9000
lobe-minio | WebUI: http://172.18.0.3:9001 http://127.0.0.1:9001
lobe-minio |
lobe-minio | Docs: https://docs.min.io
lobe-postgres |
lobe-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
lobe-postgres |
lobe-minio | INFO:
lobe-minio | You are running an older version of MinIO released 4 days before the latest release
lobe-minio | Update: Run mc admin update ALIAS
lobe-minio |
lobe-postgres | 2025-01-17 10:09:20.977 UTC [1] LOG: starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
lobe-minio |
lobe-postgres | 2025-01-17 10:09:20.977 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
lobe-postgres | 2025-01-17 10:09:20.977 UTC [1] LOG: listening on IPv6 address "::", port 5432
lobe-postgres | 2025-01-17 10:09:20.984 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
lobe-postgres | 2025-01-17 10:09:21.027 UTC [29] LOG: database system was shut down at 2025-01-17 10:09:05 UTC
lobe-postgres | 2025-01-17 10:09:21.229 UTC [1] LOG: database system is ready to accept connections
lobe-postgres | 2025-01-17 10:09:25.636 UTC [41] ERROR: database "casdoor" already exists
lobe-postgres | 2025-01-17 10:09:25.636 UTC [41] STATEMENT: CREATE DATABASE casdoor;
lobe-chat | 🌐 DNS Server: [ '127.0.0.11' ]
lobe-chat | -------------------------------------
lobe-chat | [Database] Start to migration...
lobe-chat | ✅ database migration pass.
lobe-chat | -------------------------------------
lobe-chat | ▲ Next.js 15.1.4
lobe-chat | - Local: http://localhost:3210
lobe-chat | - Network: http://0.0.0.0:3210
lobe-chat |
lobe-chat | ✓ Starting...
lobe-chat | ✓ Ready in 125ms
lobe-casdoor | 2025/01/17 10:09:28 Starting Radius server on 0.0.0.0:1812
lobe-casdoor | 2025/01/17 10:09:28 Listening on 0.0.0.0:389
lobe-casdoor | 2025/01/17 10:09:28.180 [I] http server Running on http://:8000
lobe-chat | {
lobe-chat | allowDangerousEmailAccountLinking: true,
lobe-chat | clientId: undefined,
lobe-chat | clientSecret: undefined,
lobe-chat | platformType: 'WebsiteApp',
lobe-chat | profile: [Function: profile]
lobe-chat | }
lobe-chat | (node:28) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
lobe-chat | (Use node --trace-deprecation ... to show where the warning was created)
lobe-chat | {
lobe-chat | allowDangerousEmailAccountLinking: true,
lobe-chat | clientId: undefined,
lobe-chat | clientSecret: undefined,
lobe-chat | platformType: 'WebsiteApp',
lobe-chat | profile: [Function: profile]
lobe-chat | }
lobe-chat | 执行第 1 个任务
lobe-chat | 任务[1]: embeddings: 0.148ms
lobe-chat | embeddingChunks error { message: '{}', name: 'EmbeddingError' }
lobe-postgres | 2025-01-17 10:14:21.029 UTC [27] LOG: checkpoint starting: time
lobe-postgres | 2025-01-17 10:14:32.064 UTC [27] LOG: checkpoint complete: wrote 107 buffers (0.7%); 0 WAL file(s) added, 0 removed, 0 recycled; write=10.836 s, sync=0.100 s, total=11.036 s; sync files=80, longest=0.016 s, average=0.002 s; distance=412 kB, estimate=412 kB; lsn=0/2C95AA8, redo lsn=0/2C95A70

@thunderbug1 thunderbug1 added the 🐛 Bug Something isn't working | 缺陷 label Jan 17, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Jan 17, 2025
@lobehubbot
Copy link
Member

👀 @thunderbug1

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@dosubot dosubot bot added the azure label Jan 17, 2025
Copy link

dosubot bot commented Jan 17, 2025

I found a similar discussion that might be relevant to your issue: Embedding Error: Requested 9064 tokens instead of 8192 tokens, which is still open [1].

To configure a custom embedding model using Azure OpenAI in Lobe Chat, ensure that your environment variables are set correctly. Here are the key configurations you should verify:

  1. API Key and Endpoint: Ensure that AZURE_API_KEY and AZURE_ENDPOINT are correctly set with your Azure OpenAI credentials.

  2. Model List and Mapping: The AZURE_MODEL_LIST and AZURE_OPENAI_MODEL_MAPPER should correctly map your desired models. For example, ensure that the model names and deployment names match those available in your Azure account.

  3. API Version: Verify that AZURE_API_VERSION is set to a valid version supported by Azure OpenAI.

  4. Default Embedding Model: Ensure that DEFAULT_FILES_CONFIG is correctly set to use the available embedding model in your region.

If the error persists, you might want to enable debugging to capture more detailed information about the error. You can do this by setting the environment variable DEBUG_XAI_CHAT_COMPLETION to 1 to get more insights into the issue [2].

These steps should help you troubleshoot and resolve the embedding model configuration error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dddtc2005
Copy link

I have the exact same issue with Vercel-based deployment.
My env setup:

AZURE_MODEL_LIST=gpt-4o->gpt-4o=gpt-4o,gpt-4o-mini->gpt-4o-mini=gpt-4o-mini,text-embedding-3-small->text-embedding-3-small=text-embedding-3-small,gpt-35-turbo->gpt-35-turbo=gpt-35-turbo
DEFAULT_FILES_CONFIG=embedding_model=azure/text-embedding-3-small

In addition, I have tried to test if AZURE_API_VERSION was the issue, since Azure models have different versions. It didn't turn out to be the problem.

@thanatchon36
Copy link

thanatchon36 commented Jan 22, 2025

I am experiencing the same issue with my Vercel-based deployment. While I can successfully communicate with the Azure GPT-4o model and upload files, the embedding process consistently fails.

My environment setup is as follows:

AZURE_MODEL_LIST="gpt-4o->gpt-4o=gpt-4o-deploy03,text-embedding-3-small->text-embedding-3-small-lobechat01=text-embedding-3-small"
DEFAULT_FILES_CONFIG="embedding_model=azure/text-embedding-3-small,reranker_model=cohere/rerank-english-v3.0,query_mode=full_text"
AZURE_API_VERSION="2023-05-15"

Here are the relevant logs from Lobe Chat:

lobe-chat      | 执行第 1 个任务
lobe-chat      | 任务[1]: embeddings: 0.056ms
lobe-chat      | embeddingChunks error { message: '{}', name: 'EmbeddingError' }
lobe-chat      | (node:28) Warning: Label '任务[1]: insert db' already exists for console.time()
lobe-postgres  | 2025-01-21 11:48:32.347 UTC [28] LOG:  checkpoint starting: time
lobe-postgres  | 2025-01-21 11:48:37.821 UTC [28] LOG:  checkpoint complete: wrote 53 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=5.451 s, sync=0.006 s, total=5.474 s; sync files=37, longest=0.001 s, average=0.001 s; distance=222 kB, estimate=324 kB; lsn=0/26486E8, redo lsn=0/26486B0

I have verified that my Azure setup supports the models I am using, and I also tested if AZURE_API_VERSION could be causing the issue. Unfortunately, updating the version did not resolve the problem.

I would greatly appreciate any further insights or guidance on resolving this issue.

Image

And as you can see, I can connect to the embeddings models by saying hi in the same room and selecting an embedding model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure 🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

4 participants