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

add in response headers to streaming endpoint #282

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

noyoshi
Copy link
Collaborator

@noyoshi noyoshi commented Feb 26, 2024

  • Added response headers from generate into generate_stream endpoint. Next will be to add them to the open AI compatible endpoints.

Copy link
Contributor

@brightsparc brightsparc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be useful to add prompt tokens since we should have these when outputting the initial access log?

headers.insert("x-adapter-source", adapter_source.unwrap().parse().unwrap());
}

headers.insert("x-model-id", MODEL_ID.get().unwrap().parse().unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also include x-prompt-tokens in lieu of x-total-tokens until we solve log capture?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that can wait until another PR


if adapter_id_string.len() > 0 {
headers.insert("x-adapter-ids", adapter_id_string.parse().unwrap());
headers.insert("x-adapter-source", adapter_source.unwrap().parse().unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be some guards against panics here?

@noyoshi noyoshi merged commit 362ee41 into main Feb 26, 2024
1 check passed
@noyoshi noyoshi deleted the expose-headers-in-streaming-endpoint branch February 26, 2024 23:32
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

Successfully merging this pull request may close these issues.

4 participants