Skip to content

Conversation

@umago
Copy link
Contributor

@umago umago commented Jun 6, 2025

Description

This patch adds the /feedback endpoint.

Note: Authentication and user ID retrieval haven't been included yet, as they don't appear to be implemented in the Lightspeed Llama-stack version. TODOs were left in the code for those parts.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Enable the feedback via the configuration file and you can curl it
  • Run unit-tests

@umago umago force-pushed the feedback-endpoint branch 3 times, most recently from 360c063 to 3e73b95 Compare June 6, 2025 10:16
This patch adds the /feedback endpoint.

Note: Authentication and user ID retrieval haven't been included yet,
as they don't appear to be implemented in the Lightspeed Llama-stack
version. TODOs were left in the code for those parts.

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
@umago umago force-pushed the feedback-endpoint branch from 3e73b95 to 098ad30 Compare June 6, 2025 10:18
@tisnik
Copy link
Contributor

tisnik commented Jun 6, 2025

yup we need this. Will take me some time to review, but I promise to do it

@umago
Copy link
Contributor Author

umago commented Jun 6, 2025

@tisnik no rush!

Copy link

@lpiwowar lpiwowar left a comment

Choose a reason for hiding this comment

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

I just quickly went through the PR. But overall I think it looks good:)


user_id = retrieve_user_id(auth)
try:
store_feedback(user_id, feedback_request.model_dump(exclude={"model_config"}))
Copy link

Choose a reason for hiding this comment

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

thought: I'm thinking about whether it would make sense to set some upper limit on the length of the user's feedback. This would be to prevent resource exhaustion if some malicious party decides to test out the endpoint.

question: Is the plan to store the feedback later somewhere in a DB and not in a plaintext file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, we can think of that as well. For now, I'm just mimicking what was present in the previous service.

Regarding the question, looking at the data collection [0], it does seem like it still sends it in plain-text. It's just zipped and sent to console.redhat.com. May be something we want to change too.

But I think these things can be added on top of this work. For now, keeping it compatible to what it was before seems fine IMHO.

[0] https://github.com/road-core/service/tree/643164b47ea1cf9c91bd5a1ce3cadbed1fb3faa4/ols/user_data_collection

Copy link

Choose a reason for hiding this comment

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

Yes, definitely I think this is a good start! 👍 I was just curious.

Thanks for the link, it makes it a bit clearer to me. I do not know much about the feedback part.

Copy link
Contributor

Choose a reason for hiding this comment

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

basically yes, the plan is to use DB (probably sqlite as it's used a lot in llama-stack itself). The JSON as files solution was easier to implement in openshift scenario, but personally I don't like it very much TBH :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@lpiwowar +1 for having config to limit feedback. Would you like to create a ticket for it? Or if you don't want to, I can take it, whatever

Copy link
Contributor

Choose a reason for hiding this comment

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

True, we can think of that as well. For now, I'm just mimicking what was present in the previous service.

Regarding the question, looking at the data collection [0], it does seem like it still sends it in plain-text. It's just zipped and sent to console.redhat.com. May be something we want to change too.

If the format would change, also the pipelines in RH network will need changes... But doable, of course ;)

Copy link

Choose a reason for hiding this comment

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

@tisnik I can take a look at the limiting of the feedback. I'll create a ticket:).

Copy link
Contributor

Choose a reason for hiding this comment

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

deal @lpiwowar :) TYVM

Copy link

Choose a reason for hiding this comment

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

Ticket created:), @umago it is on our board as well. It's a small ticket, but I'm just being transparent. I guess we are still figuring out how to best collaborate together.

If the format would change, also the pipelines in RH network will need changes... But doable, of course ;)

Yes:), I guess this change would be a bit bigger. I guess if it works, then it is fine for now (?). Maybe something we might want to take later?

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

It looks good, let's use it! Thank you

@tisnik tisnik merged commit d55c77c into lightspeed-core:main Jun 6, 2025
17 checks passed
@umago umago deleted the feedback-endpoint branch June 6, 2025 13:53
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.

3 participants