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

Fix ChatGPT API endpoint #6

Closed
AlexCheema opened this issue Jul 16, 2024 · 3 comments
Closed

Fix ChatGPT API endpoint #6

AlexCheema opened this issue Jul 16, 2024 · 3 comments

Comments

@AlexCheema
Copy link
Contributor

Currently doesn't work - which means the only way to access inference is via peer handles in Python, which isn't very user-friendly for applications to add a new library.

@AlexCheema
Copy link
Contributor Author

One of the issues here is that since we don't treat any node as a "master" or "worker" (all nodes are equal), the "head" and "tail" nodes are dynamic. However, the prompt needs to be sent to the "head" and the tokens are received by the "tail".

We could hack this by breaking the p2p equality assumption, but that would need to be fixed down the line.

The better thing is to:

  • forward the prompt until you hit the "head" (this should be fairly simple).
  • forward API requests to the "tail" that has all the generated tokens (this sounds hard and hacky). The other thing we can do is only serve the API from the "tail"

@AlexCheema
Copy link
Contributor Author

AlexCheema commented Jul 16, 2024

Fixed the former: 1d5c28a
The latter is harder and for now, we'll only support API requests to the "tail". You can always force a node to be the "tail" by specifying its node-id to be sorted last e.g. with python3 main.py --node-id "xxx-node"

@AlexCheema
Copy link
Contributor Author

Fixed in f2895cb

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

No branches or pull requests

1 participant