Skip to content

Conversation

yanxi0830
Copy link
Contributor

@yanxi0830 yanxi0830 commented Oct 1, 2024

CLI Reference

llama-stack-client

$ llama-stack-client -h

usage: llama-stack-client [-h] {models,memory_banks,shields} ...

Welcome to the LlamaStackClient CLI

options:
  -h, --help            show this help message and exit

subcommands:
  {models,memory_banks,shields}

llama-stack-client configure

$ llama-stack-client configure
> Enter the host name of the Llama Stack distribution server: localhost
> Enter the port number of the Llama Stack distribution server: 5000
Done! You can now use the Llama Stack Client CLI with endpoint http://localhost:5000

llama-stack-client models list

llama-stack-client models list

image

llama-stack-client models get

llama-stack-client models get Llama3.1-8B-Instruct

image

$ llama-stack-client models get Random-Model 

Model RandomModel is not found at distribution endpoint host:port. Please ensure endpoint is serving specified model.

llama-stack-client memory_banks list

llama-stack-client memory_banks list

image

llama-stack-client shields list

llama-stack-client shields list

image

@yanxi0830 yanxi0830 marked this pull request as ready for review October 1, 2024 03:27
@raghotham
Copy link
Contributor

I should be able to just configure the client cli to point to a host by providing an API key if needed.

$ llama-stack-client configure
host: ...
port: ...
api_key: ...

After that, I should be able to do:

$ llama-stack-client <models|memory_banks|shields> <list|get>

without having to specify host/port each time.

Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

Requesting changes mainly for Raghu's comment on doing a configuration first and then reusing those values for contacting the distribution server.

A small nit -- can the cli directory be placed until src/llama_stack_client instead of inside src/llama_stack_client/lib/

@yanxi0830
Copy link
Contributor Author

Requesting changes mainly for Raghu's comment on doing a configuration first and then reusing those values for contacting the distribution server.

A small nit -- can the cli directory be placed until src/llama_stack_client instead of inside src/llama_stack_client/lib/

For purely additive helper or utility code, consider adding it to the package's lib directory. Stainless will never modify the contents of these directories.

I put it to lib for now to be compatible w/ Stainless's custom code suggestion, and think may us save some further trouble when syncing. We can do further refactor when API is more stable.

Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

This looks pretty reasonable to me, but I want to have @raghotham take one look at it since he has had a lot of thoughts on how precisely this needs to work.

type=str,
help="Llama Stack distribution port number",
)
self.parser.add_argument(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should have this one if we have separate host and port arguments. It feels confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that if we have an endpoint like https://llama-stack.together.ai, we don't need to specify separate host:port args.


self.endpoint = get_config().get("endpoint")
self.parser.add_argument(
"--endpoint",
Copy link
Contributor

Choose a reason for hiding this comment

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

So I think @raghotham wanted things to work like the aws CLI. i.e., there's a notion of a "profile"... its default value is "default". And you can update the default. And then each command gets an optional "profile" name which it uses to look up the corresponding YAML and gets all its values from there.

Specifically, we should never have an endpoint here (and in all commands) but only a "name" which represents a link to the YAML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, my understanding is that for now we only have endpoint to store in "profile", but I could remove this --endpoint s.t. we read from "profile" config only.

f.write(
yaml.dump(
{
"endpoint": endpoint,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently saves endpoint only, could introduce a map later if we want to store different endpoints.

Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

Let's get this in!

@yanxi0830 yanxi0830 merged commit 2cf0adb into main Oct 3, 2024
3 checks passed
@yanxi0830 yanxi0830 deleted the llamastackclient_cli branch October 3, 2024 18:14
@yanxi0830 yanxi0830 mentioned this pull request Nov 13, 2024
eranco74 pushed a commit to eranco74/llama-stack-client-python that referenced this pull request Jul 20, 2025
These are the changes we had made on top of whatever Stainless
generates. We are going to get them into this repository now so (a)
future updates can just be simple PRs from Stainless and (b) we can
directly publish from the repository.
eranco74 pushed a commit to eranco74/llama-stack-client-python that referenced this pull request Jul 20, 2025
Automated Release PR
---


## 0.1.0-alpha.3 (2025-06-27)

Full Changelog:
[v0.1.0-alpha.2...v0.1.0-alpha.3](llamastack/llama-stack-client-python@v0.1.0-alpha.2...v0.1.0-alpha.3)

### Features

* **api:** update via SDK Studio
([e87f225](llamastack@e87f225))
* make custom code changes
([llamastack#3](llamastack#3))
([83fa371](llamastack@83fa371))

---
This pull request is managed by Stainless's [GitHub
App](https://github.com/apps/stainless-app).

The [semver version
number](https://semver.org/#semantic-versioning-specification-semver) is
based on included [commit
messages](https://www.conventionalcommits.org/en/v1.0.0/).
Alternatively, you can manually set the version number in the title of
this pull request.

For a better experience, it is recommended to use either rebase-merge or
squash-merge when merging this pull request.

🔗 Stainless [website](https://www.stainlessapi.com)
📚 Read the [docs](https://app.stainlessapi.com/docs)
🙋 [Reach out](mailto:support@stainlessapi.com) for help or questions

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants