microsoft / graphrag

A modular graph-based Retrieval-Augmented Generation (RAG) system
https://microsoft.github.io/graphrag/
MIT License
17.31k stars 1.65k forks source link

bug report: create_final_community_reports did not use the `community_report: llm:` in setting.yaml #379

Closed KylinMountain closed 2 months ago

KylinMountain commented 2 months ago

when you override llm in

community_report:
  llm:

it always use the llm in setting.yaml when create_final_community_reports

KylinMountain commented 2 months ago

seccond bug: when doing query, some config is not load from setting.yaml.

llm:
  api_key: sk-xxxxx
  type: openai_chat # or azure_openai_chat
  model: moonshot-v1-32k
  model_supports_json: false # recommended if this is available for your model.
  api_base: https://api.moonshot.cn/v1
  max_tokens: 32768
  concurrent_requests: 1 # the number of parallel inflight requests that may be made
  tokens_per_minute: 32000 # set a leaky bucket throttle
  requests_per_minute: 3 # set a leaky bucket throttle
  # request_timeout: 180.0
  # api_version: 2024-02-15-preview
  # organization: <organization_id>
  # deployment_name: <azure_model_deployment_name>
  max_retries: 3
  max_retry_wait: 10
  sleep_on_rate_limit_recommendation: true # whether to sleep when azure suggests wait-times

I have set tokens_per_minute to 32000, but it loads with 'tokens_per_minute': 0, 'requests_per_minute': 0.

INFO: Reading settings from settings.yaml
creating llm client with {'api_key': 'REDACTED,len=51', 'type': "openai_chat", 'model': 'moonshot-v1-32k', 'max_tokens': 32768, 'request_timeout': 180.0, 'api_base': 'https://api.moonshot.cn/v1', 'api_version': None, 'organization': None, 'proxy': None, 'cognitive_services_endpoint': None, 'deployment_name': None, 'model_supports_json': False, 'tokens_per_minute': 0, 'requests_per_minute': 0, 'max_retries': 3, 'max_retry_wait': 10.0, 'sleep_on_rate_limit_recommendation': True, 'concurrent_requests': 1}
KylinMountain commented 2 months ago

Update the tokens_per_minute to tpm and requests_per_minute to rpm will work.

AlonsoGuevara commented 2 months ago

Hi @KylinMountain Thanks for reporting and updating!

I'll be taking a look at the community_report:llm issue you reported. Regarding #382 I updated your PR with the resolution from another PR

Thanks for contributing, we appreciate this.

Boy124578 commented 2 months ago

Update the tokens_per_minute to tpm and requests_per_minute to rpm will work.

portalmk2 commented 2 months ago

The field name defined in GraphRagConfig is community_reports, while the settings.yaml created by the project initialization code (init_content.py) has community_report. This mismatch prevents the corresponding configuration from being read. Change 'community_report:' to 'community_reports:' in your settings.yaml and it will work.