8000 add a default value for endpoint url option by reidliu41 · Pull Request #2839 · instructlab/instructlab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add a default value for endpoint url option #2839

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

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

Conversation

reidliu41
Copy link
Contributor
@reidliu41 reidliu41 commented Dec 26, 2024

Some users might not know the default endpoint url is url + v1 = http://127.0.0.1:8000/v1, so add it in description.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the
    conventional commits.
  • Changelog updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Functional tests have been added, if necessary.
  • E2E Workflow tests have been added, if necessary.

Signed-off-by: reid_liu <guliu@redhat.com>
@reidliu41 reidliu41 requested review from cdoern and RobotSail January 9, 2025 23:09
Copy link
Member
@RobotSail RobotSail left a comment

Choose a reason for hiding this comment

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

I like the idea behind this, though we have some established ways of presenting defaults. It might be worth exploring those options as well.

@@ -124,7 +124,7 @@ def is_openai_server_and_serving_model(
@click.option(
"--endpoint-url",
type=click.STRING,
help="Custom URL endpoint for OpenAI-compatible API. Defaults to the `ilab model serve` endpoint.",
help="Custom URL endpoint for OpenAI-compatible API. Defaults to the `ilab model serve` endpoint (http://127.0.0.1:8000/v1).",
Copy link
Member

Choose a reason for hiding this comment

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

Is this something that gets read from the config if not passed in as a flag? If so, what happens if it's a different value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it(endpoint_url) will read config file. It based on host and port. If value like --port 1234, it need to specify --endpoint-url.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. But I check, if the option set it read from config, it should read it from configuration, not config file(please correct me if I am wrong), because change the value from config file, it will not change value from --help.
    e.g.
default:
@click.option(
    "--gpu-layers",
    type=click.INT,
    cls=clickext.ConfigOption,
    config_sections="llama_cpp",
    required=True,  # default from config
)

  --gpu-layers INTEGER        Number of model layers to offload to GPU. -1
                              means all layers. [required; default: -1; <<<<<<---
                              config
8000
: 'serve.llama_cpp.gpu_layers']

$ ilab config show -k serve.llama_cpp -wc
gpu_layers: -1     <<<<<<---
llm_family: ''
max_ctx_size: 4096

change:
$ ilab config show -k serve.llama_cpp -wc
gpu_layers: -2  <<<<<<---
llm_family: ''
max_ctx_size: 4096
  --gpu-layers INTEGER        Number of model layers to offload to GPU. -1
                              means all layers. [required; default: -1; <<<<<<---
                              config: 'serve.llama_cpp.gpu_layers']
  1. So based on this default value, the default endpoint_url value in --help should based on host: 127.0.0.1 and port: 8000 in the config field, unless change it. If it need to change, seems other also need to change to read it from config 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.

hi @RobotSail any suggestions that I need to modify? Actually, my purpose is simple just share the api example, may try to avoid the situation like #2287

Copy link
Contributor

Choose a reason for hiding this comment

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

@RobotSail any thoughts?

@reidliu41
Copy link
Contributor Author

I like the idea behind this, though we have some established ways of presenting defaults. It might be worth exploring those options as well.

Yeah, sometimes it might be confused for the users, seems only the developer who created this option and he/she should very clear about this option/function. So make some simple tips, user can easy to use it, even a word.

@reidliu41 reidliu41 requested a review from RobotSail January 13, 2025 09:00
@reidliu41 reidliu41 requested a review from a team January 29, 2025 03:36
Copy link
Contributor
mergify bot commented Jan 29, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. @reidliu41 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase This Pull Request needs to be rebased label Jan 29, 2025
@mergify mergify bot removed the needs-rebase This Pull Request needs to be rebased label Apr 28, 2025
Copy link
Contributor
mergify bot commented Apr 28, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @reidliu41 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase This Pull Request needs to be rebased label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase This Pull Request needs to be rebased
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0