add headers and pass model parameter to llm node #4933

Closed
opened 2026-02-21 18:08:40 -05:00 by yindo · 4 comments
Owner

Originally created by @Donglong on GitHub (Aug 7, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

  1. we have a llm proxy service that supports adding some headers for tracking.
  2. we support users to choose the model.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @Donglong on GitHub (Aug 7, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. 1. we have a llm proxy service that supports adding some headers for tracking. 2. we support users to choose the model. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:08:40 -05:00
yindo closed this issue 2026-02-21 18:08:40 -05:00
Author
Owner

@crazywoola commented on GitHub (Aug 7, 2024):

Can you give us some examples for better understanding?

@crazywoola commented on GitHub (Aug 7, 2024): Can you give us some examples for better understanding?
Author
Owner

@Donglong commented on GitHub (Aug 7, 2024):

  1. for example, we can add the following request headers for tracking
    a. x-ai-trace-id
    b. x-ai-user-id
    c. x-ai-metadata
    d. ...

this is a request example:

 curl https://api.xxxxai.com/v1/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -H "X-AI-TRACE-ID: $TRACE_ID" \
  -H "X-AI-USER-ID: $USER_ID" \
  -H "X-AI-METADATA: $METADATA" \
  -d '{
    "model": "gpt-3.5-turbo-instruct",
    "prompt": "Say this is a test",
    "max_tokens": 7,
    "temperature": 0
  }'

2.For example, on the openai official website, you can choose the model when chatting. the model parameter is not fixed on the llm node.
@crazywoola

@Donglong commented on GitHub (Aug 7, 2024): 1. for example, we can add the following request headers for tracking a. x-ai-trace-id b. x-ai-user-id c. x-ai-metadata d. ... this is a request example: ``` curl https://api.xxxxai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ -H "X-AI-TRACE-ID: $TRACE_ID" \ -H "X-AI-USER-ID: $USER_ID" \ -H "X-AI-METADATA: $METADATA" \ -d '{ "model": "gpt-3.5-turbo-instruct", "prompt": "Say this is a test", "max_tokens": 7, "temperature": 0 }' ``` 2.For example, on the openai official website, you can choose the model when chatting. the model parameter is not fixed on the llm node. @crazywoola
Author
Owner

@crazywoola commented on GitHub (Aug 7, 2024):

It can be done like this, however, to change the models in api level is not the way we want.

image
@crazywoola commented on GitHub (Aug 7, 2024): It can be done like this, however, to change the models in api level is not the way we want. <img width="844" alt="image" src="https://github.com/user-attachments/assets/8473065f-756c-4e3a-a2a3-3200ef6cb034">
Author
Owner

@Donglong commented on GitHub (Aug 8, 2024):

yes, but why not design it to be more flexible? can you tell me the reason for this design? Is it possible to support adding headers to llm node? @crazywoola

@Donglong commented on GitHub (Aug 8, 2024): yes, but why not design it to be more flexible? can you tell me the reason for this design? Is it possible to support adding headers to llm node? @crazywoola
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4933