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

feat: add custom restful backend for complex scenarios (e.g, rag) #1228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

popsiclexu
Copy link

@popsiclexu popsiclexu commented Aug 16, 2024

📑 Description

Add a new backend that allows access to a custom API, enabling the integration of personalized services into k8sgpt. For example, it supports the integration of RAG services to enhance the accuracy of responses based local knowledge.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Usage

# ./bin/k8sgpt auth add --backend customrest --baseurl http://localhost:8090/completion --model llama3.1
customrest added to the AI backend provider list
# ./k8sgpt analyze --backend customrest --explain --filter=Pod
100% |█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (2/2, 8 it/min)
AI Provider: customrest

0: Pod cluster-sample-ns/minio-harborcluster-sample-zone-harbor-0()
- Error: 0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims.
Error: No available nodes to schedule pods, unbound PersistentVolumeClaims exist.

Solution: 
1. Check PersistentVolumeClaims (PVCs) and delete any unused ones.
2. Update PVCs with correct storage class or request.
3. Scale down or delete pods using the problematic PVCs.

You cant get a tutorial for customrest backend from https://github.com/popsiclexu/k8sgpt-docs/blob/feat/customrest/docs/tutorials/custom-rest-backend.md.
And the docs pr is k8sgpt-ai/docs#120

@popsiclexu popsiclexu requested review from a team as code owners August 16, 2024 08:17
@popsiclexu popsiclexu force-pushed the feat/customrest-backend branch 2 times, most recently from b9b8b3e to a03b89e Compare August 16, 2024 08:26
Copy link
Contributor

@matthisholleville matthisholleville left a comment

Choose a reason for hiding this comment

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

Thank you for your PR—great work! We need to discuss further how we'll support RAG as an AI Provider.

For example, what types of authentication will we support? How should we include tests and tutorials in our documentation? etc.

By the way, your PR is an excellent starting point for this discussion.

pkg/ai/customrest.go Outdated Show resolved Hide resolved
pkg/ai/customrest.go Outdated Show resolved Hide resolved
@popsiclexu popsiclexu force-pushed the feat/customrest-backend branch 2 times, most recently from ce12a83 to 8381688 Compare August 21, 2024 07:09
@popsiclexu
Copy link
Author

Thank you for your PR—great work! We need to discuss further how we'll support RAG as an AI Provider.

For example, what types of authentication will we support? How should we include tests and tutorials in our documentation? etc.

By the way, your PR is an excellent starting point for this discussion.

I added a tutorial for this: https://github.com/popsiclexu/k8sgpt-docs/blob/feat/customrest/docs/tutorials/custom-rest-backend.md.
And the docs pr is k8sgpt-ai/docs#120

@arbreezy
Copy link
Member

@popsiclexu is this not possible with localai as a backend ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Proposed
Development

Successfully merging this pull request may close these issues.

3 participants