Closed
Description
I'd like to propose a future feature I think would add useful flexibility for users of the completions/embeddings
API . I'm suggesting the ability to dynamically load models based on calls to the FastAPI
endpoint.
The concept is as follows:
- Have a predefined location for model files (e.g., a
models
folder within the project) and allow users to specify an additional model folder if needed. - When the API starts, it checks the designated model folders and populates the available models dynamically.
- Users can query the available models through a
GET
request to the/v1/engines
endpoint , which would return a list of models and their statuses. - Users can then specify the desired model when making inference requests.
This dynamic model loading feature would align with the behavior of the OpenAI spec for models and model status. It would offer users the flexibility to easily choose and use different models without having make manual changes to the project or configs.
This is a suggestion for later, but I wanted to suggest it now so we can plan if we do decide to implement it.
Let me know your thoughts :)
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
0xdevalias commentedon Apr 11, 2023
Potentially related:
/models/{model}
endpoint #38/models/{model}
endpoint #38jmtatsch commentedon Apr 12, 2023
@abetlen requested a list of prompt formats for various models
Alpaca:
Vicuna:
as discussed in ggml-org/llama.cpp#302 (comment)
Koala:
source: https://github.com/young-geng/EasyLM/blob/main/docs/koala.md
Open Assistant: (no llama.cpp support yet)
Source: https://github.com/LAION-AI/Open-Assistant/blob/8818d5515a5d889332d051b7989091648c017c20/model/MESSAGE_AND_TOKEN_FORMAT.md
MillionthOdin16 commentedon Apr 13, 2023
@abetlen
Here's something that seemed interesting from vicuna that I just saw. I can definitely see the challenge trying to adapt to all these different input formats. This seemed like an extendable format that might help, not sure where you currently are on it.
https://github.com/lm-sys/FastChat/blob/00d9e6675bdff60be6603ffff9313b1d797d2e3e/fastchat/conversation.py#L83-L112
Edit:
I actually don't know if they're using fast API 😂 now that I actually look more at it, it looks very similar.
abetlen commentedon Apr 13, 2023
@jmtatsch @MillionthOdin16 thank you!
I still have a few questions on the best way to implement this, appreciate any input.
The basic features would allow you to:
The part I'm still scratching my head on are the chat models
I guess the solution would be to have some way to specify these pre-defined models and custom prompt serialisation functions for each.
docmeth02 commentedon Apr 13, 2023
Hi!
the way i implemented this on a local copy is that i added a method called generate_completion_prompts to llama_cpp.Llama that returns the PROMPT strin and the PROMPT_STOP list.
That way you can override the prompt generation from the outside and you could provide a list of model specific implementations to handle the message history and prompt generation on a per model basis :)
Update chat prompt
abetlen commentedon Dec 22, 2023
Implemented in #931