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

how to use deepseek model with wrenai #1474

Open
zhenglu696 opened this issue Mar 27, 2025 · 1 comment
Open

how to use deepseek model with wrenai #1474

zhenglu696 opened this issue Mar 27, 2025 · 1 comment

Comments

@zhenglu696
Copy link

I am using the deepseek model. When using the demo data from the official website, the following error is reported:

Image

Please help me find out where the problem is in the configuration file.

-----config.yaml:-----------
type: llm
provider: litellm_llm
models:

put DEEPSEEK_API_KEY=<your_api_key> in ~/.wrenai/.env

  • api_base: https://api.deepseek.com/v1
    model: deepseek/deepseek-reasoner
    alias: default
    timeout: 120
    kwargs:
    n: 1
    temperature: 0
    response_format:
    type: text
  • api_base: https://api.deepseek.com/v1
    model: deepseek/deepseek-chat
    timeout: 120
    kwargs:
    n: 1
    temperature: 0
    response_format:
    type: text
  • api_base: https://api.deepseek.com/v1
    model: deepseek/deepseek-coder
    timeout: 120
    kwargs:
    n: 1
    temperature: 0
    response_format:
    type: json_object

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: deepseek/deepseek-r1-distill-qwen-14b # put your embedding model name here, if it is not openai embedding model, should be /<model_name>
    alias: default
    api_base: https://api.deepseek.com/v1 # change this according to your embedding model
    timeout: 120

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


type: engine
provider: wren_ibis
endpoint: http://wren-ibis:8000


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


please change the llm and embedder names to the ones you want to use

the format of llm and embedder should be .<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://raw.githubusercontent.com/canner/WrenAI/<WRENAI_VERSION_NUMBER>/docker/config.example.yaml

type: pipeline
pipes:

  • name: db_schema_indexing
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: historical_question_indexing
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: table_description_indexing
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: db_schema_retrieval
    llm: litellm_llm.default
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: historical_question_retrieval
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: sql_generation
    llm: litellm_llm.default
    engine: wren_ui
  • name: sql_correction
    llm: litellm_llm.default
    engine: wren_ui
  • name: followup_sql_generation
    llm: litellm_llm.default
    engine: wren_ui
  • name: sql_summary
    llm: litellm_llm.default
  • name: sql_answer
    llm: litellm_llm.default
    engine: wren_ui
  • name: sql_breakdown
    llm: litellm_llm.default
    engine: wren_ui
  • name: sql_expansion
    llm: litellm_llm.default
    engine: wren_ui
  • name: semantics_description
    llm: litellm_llm.default
  • name: relationship_recommendation
    llm: litellm_llm.default
    engine: wren_ui
  • name: question_recommendation
    llm: litellm_llm.default
  • name: question_recommendation_db_schema_retrieval
    llm: litellm_llm.default
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: question_recommendation_sql_generation
    llm: litellm_llm.default
    engine: wren_ui
  • name: chart_generation
    llm: litellm_llm.default
  • name: chart_adjustment
    llm: litellm_llm.default
  • name: intent_classification
    llm: litellm_llm.default
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: data_assistance
    llm: litellm_llm.default
  • name: sql_pairs_indexing
    document_store: qdrant
    embedder: litellm_embedder.default
  • name: sql_pairs_retrieval
    document_store: qdrant
    embedder: litellm_embedder.default
    llm: litellm_llm.default
  • name: preprocess_sql_data
    llm: litellm_llm.default
  • name: sql_executor
    engine: wren_ui
  • name: sql_question_generation
    llm: litellm_llm.default
  • name: sql_generation_reasoning
    llm: litellm_llm.default
  • name: followup_sql_generation_reasoning
    llm: litellm_llm.default
  • name: sql_regeneration
    llm: litellm_llm.default
    engine: wren_ui
  • name: instructions_indexing
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: instructions_retrieval
    embedder: litellm_embedder.default
    document_store: qdrant
  • name: sql_functions_retrieval
    engine: wren_ibis
    document_store: qdrant
  • name: project_meta_indexing
    document_store: qdrant

settings:
column_indexing_batch_size: 50
table_retrieval_size: 10
table_column_retrieval_size: 100
allow_using_db_schemas_without_pruning: false # if you want to use db schemas without pruning, set this to true. It will be faster
allow_intent_classification: true
allow_sql_generation_reasoning: true
query_cache_maxsize: 1000
query_cache_ttl: 3600
langfuse_host: https://cloud.langfuse.com
langfuse_enable: true
logging_level: DEBUG
development: true
historical_question_retrieval_similarity_threshold: 0.9
sql_pairs_similarity_threshold: 0.7
sql_pairs_retrieval_max_size: 10
instructions_similarity_threshold: 0.7
instructions_top_k: 10

@cyyeh
Copy link
Member

cyyeh commented Apr 7, 2025

@zhenglu696 please use WREN_AI_SERVICE_VERSION=0.19.2 in ~/.wrenai/.env and use this config yaml as example

https://github.com/Canner/WrenAI/blob/main/wren-ai-service/docs/config_examples/config.deepseek.yaml

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