mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-31 16:01:46 +00:00
quick start typeddict
This commit is contained in:
parent
6569b1c840
commit
6f3b2bb815
1 changed files with 11 additions and 3 deletions
|
@ -23,8 +23,16 @@ Ensure you have the following installed on your system:
|
||||||
|
|
||||||
- **Conda**: A package, dependency, and environment management tool.
|
- **Conda**: A package, dependency, and environment management tool.
|
||||||
|
|
||||||
|
|
||||||
### 2. Installation
|
### 2. Installation
|
||||||
The `llama` CLI tool helps you manage the Llama Stack toolchain and agent systems.
|
The `llama` CLI tool helps you manage the Llama Stack toolchain and agent systems. Follow these step to install
|
||||||
|
|
||||||
|
First activate and activate your conda environment
|
||||||
|
```
|
||||||
|
conda create --name my-env
|
||||||
|
conda activate my-env
|
||||||
|
```
|
||||||
|
Then install llama-stack with pip, you could also check out other installation methods [here](https://llama-stack.readthedocs.io/en/latest/cli_reference/index.html).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install llama-stack
|
pip install llama-stack
|
||||||
|
@ -129,8 +137,8 @@ client = LlamaStackClient(base_url="http://localhost:5000")
|
||||||
# Create a chat completion request
|
# Create a chat completion request
|
||||||
response = client.inference.chat_completion(
|
response = client.inference.chat_completion(
|
||||||
messages=[
|
messages=[
|
||||||
SystemMessage(content="You are a helpful assistant.", role="system"),
|
{"role": "system", "content": "You are a helpful assistant."},
|
||||||
UserMessage(content="Write me a 2-sentence poem about the moon", role="user")
|
{"role": "user", "content": "Write a two-sentence poem about llama."}
|
||||||
],
|
],
|
||||||
model="Llama3.2-3B-Instruct",
|
model="Llama3.2-3B-Instruct",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue