Skip to content

[Feature]: Expose Lora lineage information from /v1/models #6274

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

Closed
Jeffwan opened this issue Jul 10, 2024 · 1 comment
Closed

[Feature]: Expose Lora lineage information from /v1/models #6274

Jeffwan opened this issue Jul 10, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@Jeffwan
Copy link
Contributor

Jeffwan commented Jul 10, 2024

🚀 The feature, motivation and pitch

python -m vllm.entrypoints.openai.api_server \
    --model /workspace/meta-llama/Llama-2-7b-hf \
    --enable-lora \
    --lora-modules sql-lora=~/.cache/huggingface/hub/models--yard1--llama-2-7b-sql-lora-test/

The /v1/models response from above setup can not expose the lineage between lora and base models. In below example, root always points to the base_model.

Current Status

  1. Base model will either use --model or --served-model-name. If user use local path, then the id and root would not be model id like OpenAI.

  2. Lora model card information is from LoraRequest which doesn't have base_model at this moment. Technically, we can assume they are all adapters to base model. This may break later once the engine supports multiple models.

{
  "object": "list",
  "data": [
    {
      "id": "/workspace/meta-llama/Llama-2-7b-hf",
      "object": "model",
      "created": 1715644056,
      "owned_by": "vllm",
      "root": "/workspace/meta-llama/Llama-2-7b-hf",
      "parent": null,
      "permission": [
        {
          .....
        }
      ]
    },
    {
      "id": "sql-lora",
      "object": "model",
      "created": 1715644056,
      "owned_by": "vllm",
      "root": "/workspace/meta-llama/Llama-2-7b-hf",
      "parent": null,
      "permission": [
        {
          ....
        }
      ]
    }
  ]
}

Expected

We can use root to represent model path and parent to indicate base_model for lora adapters. seems they are not OpenAI protocols, we should be able to make the change

{
  "object": "list",
  "data": [
    {
      "id": "meta-llama/Llama-2-7b-hf",
      "object": "model",
      "created": 1715644056,
      "owned_by": "vllm",
      "root": "~/.cache/huggingface/hub/models--meta-llama--Llama-2-7b-hf/snapshots/01c7f73d771dfac7d292323805ebc428287df4f9/",
      "parent": null,
      "permission": [
        {
          .....
        }
      ]
    },
    {
      "id": "sql-lora",
      "object": "model",
      "created": 1715644056,
      "owned_by": "vllm",
      "root": "~/.cache/huggingface/hub/models--yard1--llama-2-7b-sql-lora-test/snapshots/0dfa347e8877a4d4ed19ee56c140fa518470028c/",
      "parent": meta-llama/Llama-2-7b-hf,
      "permission": [
        {
          ....
        }
      ]
    }
  ]
}

I am drafting a PR to address this issue and please help review whether above looks good.

Alternatives

No response

Additional context

No response

@Jeffwan
Copy link
Contributor Author

Jeffwan commented Sep 27, 2024

As #6315 merged, we can close this issue.

@Jeffwan Jeffwan closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant