Skip to content

Conversation

@ashwinb
Copy link
Contributor

@ashwinb ashwinb commented Feb 7, 2025

What does this PR do?

Enables HTTPS option for Llama Stack.

While doing so, introduces a ServerConfig sub-structure to house all server related configuration (port, ssl, etc.)

Also simplified the start_container.sh entrypoint to simply be python instead of a complex bash command line.

Test Plan

Conda:

Run:

$ llama stack build --template together
$ llama stack run --port 8322        # ensure server starts 

$ llama-stack-client configure --endpoint http://localhost:8322
$ llama-stack-client models list

Create a self-signed SSL key / cert pair. Then, using a local checkout of llama-stack-client-python, change https://github.com/meta-llama/llama-stack-client-python/blob/main/src/llama_stack_client/_base_client.py#L759 to add kwargs.setdefault("verify", False) so SSL verification is disabled. Then:

$ llama stack run --port 8322 --tls-keyfile <KEYFILE> --tls-certfile <CERTFILE>
$ llama-stack-client configure --endpoint https://localhost:8322  # notice the `https`
$ llama-stack-client models list

Also tested with containers (but of course one needs to make sure the cert and key files are appropriately provided to the container.)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 7, 2025
@ashwinb ashwinb changed the title Add HTTPS serving option feat: Add HTTPS serving option Feb 7, 2025
Copy link
Collaborator

@leseb leseb left a comment

Choose a reason for hiding this comment

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

TLS has replaced SSL, so we should s/ssl/tls/. This also seems like a great addition to the CHANGELOG! 😊 Thanks!

@ashwinb ashwinb merged commit f8f2f7f into main Feb 7, 2025
5 checks passed
@ashwinb ashwinb deleted the https branch February 7, 2025 17:39
@terrytangyuan
Copy link
Contributor

Looks great!

kaushik-himself pushed a commit to fiddlecube/llama-stack that referenced this pull request Feb 10, 2025
# What does this PR do?

Enables HTTPS option for Llama Stack. 

While doing so, introduces a `ServerConfig` sub-structure to house all
server related configuration (port, ssl, etc.)

Also simplified the `start_container.sh` entrypoint to simply be
`python` instead of a complex bash command line.

## Test Plan

Conda: 

Run:
```bash
$ llama stack build --template together
$ llama stack run --port 8322        # ensure server starts 

$ llama-stack-client configure --endpoint http://localhost:8322
$ llama-stack-client models list
```

Create a self-signed SSL key / cert pair. Then, using a local checkout
of `llama-stack-client-python`, change
https://github.com/meta-llama/llama-stack-client-python/blob/main/src/llama_stack_client/_base_client.py#L759
to add `kwargs.setdefault("verify", False)` so SSL verification is
disabled. Then:

```bash
$ llama stack run --port 8322 --tls-keyfile <KEYFILE> --tls-certfile <CERTFILE>
$ llama-stack-client configure --endpoint https://localhost:8322  # notice the `https`
$ llama-stack-client models list
```

Also tested with containers (but of course one needs to make sure the
cert and key files are appropriately provided to the container.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants