Commit graph

861 commits

Author SHA1 Message Date
Xi Yan
f9c309d05c Merge branch 'main' into testpypi-workflow 2025-01-10 14:45:44 -08:00
Xi Yan
74babf8b75 revert back 2025-01-10 14:15:47 -08:00
Xi Yan
cf673be096 revert back 2025-01-10 14:15:31 -08:00
Xi Yan
3df88b82a7 manual trigger 2025-01-10 14:15:02 -08:00
Xi Yan
de3161f164 bugfix 2025-01-10 14:14:09 -08:00
Xi Yan
0f7016aff4 instead of prefix, use full version 2025-01-10 14:09:33 -08:00
Xi Yan
d9f14e22b9 instead of prefix, use full version 2025-01-10 14:08:24 -08:00
raghotham
ff182ff6de
rename LLAMASTACK_PORT to LLAMA_STACK_PORT for consistency with other env vars (#744)
# What does this PR do?

Rename environment var for consistency

## Test Plan

No regressions

## Sources

## Before submitting

- [X] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [X] Ran pre-commit to handle lint / formatting issues.
- [X] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
Pull Request section?
- [X] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.

---------

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Co-authored-by: Yuan Tang <terrytangyuan@gmail.com>
2025-01-10 11:09:49 -08:00
Dinesh Yeduguru
8af6951106
remove conflicting default for tool prompt format in chat completion (#742)
# What does this PR do?
We are setting a default value of json for tool prompt format, which
conflicts with llama 3.2/3.3 models since they use python list. This PR
changes the defaults to None and in the code, we infer default based on
the model.

Addresses: #695 

Tests:
❯ LLAMA_STACK_BASE_URL=http://localhost:5000 pytest -v
tests/client-sdk/inference/test_inference.py -k
"test_text_chat_completion"

 pytest llama_stack/providers/tests/inference/test_prompt_adapter.py
2025-01-10 10:41:53 -08:00
Yuan Tang
24fa1adc2f
Expose LLAMASTACK_PORT in cli.stack.run (#722)
This was missed in https://github.com/meta-llama/llama-stack/pull/706. I
tested `llama_stack.distribution.server.server` but didn't test `llama
stack run`. cc @ashwinb

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-01-10 09:13:49 -08:00
Vladimir Ivić
027a46ddd7
Consolidating Memory tests under client-sdk (#703)
Summary:
Part of https://github.com/meta-llama/llama-stack/issues/651

Requirements
* add more integration tests in tests/client-sdk covering
functionalities in llama-stack-apps

Porting tests from
* llama_stack/providers/tests/memory/test_memory.py

Ensuring we cover some basic functions
* MemoryResource src/llama_stack_client/resources/memory.py
* MemoryBanksResource src/llama_stack_client/resources/memory_banks.py

Test Plan:
Run against the stack as lib
```
LLAMA_STACK_CONFIG=tests/client-sdk/memory/resources/run.yaml pytest tests/client-sdk/memory -v

tests/client-sdk/memory/test_memory.py::test_memory_bank_retrieve PASSED                                                                                                                 [ 16%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_list PASSED                                                                                                                     [ 33%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_register PASSED                                                                                                                 [ 50%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_unregister PASSED                                                                                                               [ 66%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_insert_inline_and_query PASSED                                                                                                  [ 83%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_insert_from_url_and_query PASSED                                                                                                [100%]
```


Run agianst the local server
```
LLAMA_STACK_BASE_URL=http://localhost:5000 pytest tests/client-sdk/memory -v


tests/client-sdk/memory/test_memory.py::test_memory_bank_list PASSED                                                                                                                     [ 20%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_register PASSED                                                                                                                 [ 40%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_unregister PASSED                                                                                                               [ 60%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_insert_inline_and_query PASSED                                                                                                  [ 80%]
tests/client-sdk/memory/test_memory.py::test_memory_bank_insert_from_url_and_query PASSED                                                                                                [100%]
```
2025-01-10 08:28:37 -08:00
Yuan Tang
203d36e2db
Fixed typo in default VLLM_URL in remote-vllm.md (#723)
Fixed a small typo.
2025-01-09 22:34:34 -08:00
Xi Yan
697df3e102 tested, back to workflow_dispatch/schedule 2025-01-09 21:39:38 -08:00
Xi Yan
dc9148b9d5 replace w/ curl 2025-01-09 21:38:25 -08:00
Xi Yan
c02b70632f add back workflow dispatch 2025-01-09 19:02:01 -08:00
Xi Yan
cbc288680d bugfix and add requirements 2025-01-09 18:57:01 -08:00
Xi Yan
7e574417ab bugfix 2025-01-09 18:54:22 -08:00
Xi Yan
650016ffca trigger models build 2025-01-09 18:53:28 -08:00
Xi Yan
7cdd8b94d6 trigger models build 2025-01-09 18:51:29 -08:00
Xi Yan
97d31d7ab3 add back requirements 2025-01-09 18:37:07 -08:00
Xi Yan
1ea46660a5 add back requirements 2025-01-09 18:35:05 -08:00
Vladislav Bronzov
96735e961d
Add persistence for localfs datasets (#557)
# What does this PR do?

Add persistency logic for localfs datasetio provider

- [ ] Addresses issue (#issue)


## Test Plan

Please describe:
 - tests you ran to verify your changes with result summaries.
 - provide instructions so it can be reproduced.


## Sources

Please link relevant resources if necessary.
https://github.com/meta-llama/llama-stack/issues/539

## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [x] Ran pre-commit to handle lint / formatting issues.
- [x] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.
2025-01-09 17:34:18 -08:00
Xi Yan
2847d70f38 remove dispatch on push 2025-01-09 17:25:35 -08:00
Xi Yan
5f051b210c final workflow 2025-01-09 17:24:31 -08:00
Xi Yan
4387863a19 final workflow 2025-01-09 17:24:15 -08:00
Xi Yan
dc74675dc8 add ver 2025-01-09 17:19:46 -08:00
Xi Yan
cca27819b9 fix versions 2025-01-09 17:15:47 -08:00
Xi Yan
63232d7771 remove double quotes 2025-01-09 17:09:46 -08:00
Xi Yan
d8c9798ca8 test 2025-01-09 17:07:07 -08:00
Xi Yan
0b0446f219 fix 2025-01-09 17:02:35 -08:00
Xi Yan
df55ec654e fix 2025-01-09 16:59:49 -08:00
Xi Yan
2644e096d6 bugfix 2025-01-09 16:54:04 -08:00
Xi Yan
19887139b4 update requirements 2025-01-09 16:51:49 -08:00
Xi Yan
ccd3ec142a test 2025-01-09 16:45:20 -08:00
Xi Yan
7ca2f5edb1 llama-stack-client-python 2025-01-09 16:34:20 -08:00
Xi Yan
16af87c822 test trigger 2025-01-09 16:33:18 -08:00
Xi Yan
620250324c initial test 2025-01-09 16:15:37 -08:00
Xi Yan
8527b79bfd test 2025-01-09 15:37:43 -08:00
Xi Yan
20dc1860c6 test 2025-01-09 15:22:25 -08:00
Ashwin Bharambe
4938f2fe5d
Check version incompatibility (#738)
When we bump up `major.minor` we want to make sure clients can
immediately detect a version change and appropriately error out. It is
not reasonable to keep checking for API-level backwards compatibility
across such version bumps. Over time, we will make the check based only
on the major version perhaps.

### Test Plan

Manually updated `__version__` in the client SDK to be "0.1.0" which is
incompatible with server's current version "0.0.63", got the following
error:

<img width="1077" alt="image"
src="https://github.com/user-attachments/assets/06ae4659-0a25-4c4c-a999-ce44678d4e6f"
/>

Without this update, the CLI worked correctly.
2025-01-09 14:52:06 -08:00
Ashwin Bharambe
ffc6bd4805
Add X-LlamaStack-Client-Version, rename ProviderData -> Provider-Data (#735)
Add another header so client SDKs can identify their versions which can
be used for immediate detection of possible compatibility issues. A
semver mismatch against the wrong server should be immediately flagged
and requests should be denied.

Also change `X-LlamaStack-ProviderData` to `X-LlamaStack-Provider-Data`
since that hyphenation is better.
2025-01-09 11:51:36 -08:00
Xi Yan
45cf46e62f rebase 2025-01-09 11:45:51 -08:00
Yuan Tang
b8df87bd85
Add automatic PyPI release GitHub workflow (#618)
This PR adds a workflow to automatically publish the package (including
attestations) to Python upon tag/release creation.

Note that this relies on trusted publishing:
https://docs.pypi.org/trusted-publishers/

---------

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
2025-01-09 11:29:26 -08:00
Dinesh Yeduguru
a5c57cd381
agents to use tools api (#673)
# What does this PR do?

PR #639 introduced the notion of Tools API and ability to invoke tools
through API just as any resource. This PR changes the Agents to start
using the Tools API to invoke tools. Major changes include:
1) Ability to specify tool groups with AgentConfig
2) Agent gets the corresponding tool definitions for the specified tools
and pass along to the model
3) Attachements are now named as Documents and their behavior is mostly
unchanged from user perspective
4) You can specify args that can be injected to a tool call through
Agent config. This is especially useful in case of memory tool, where
you want the tool to operate on a specific memory bank.
5) You can also register tool groups with args, which lets the agent
inject these as well into the tool call.
6) All tests have been migrated to use new tools API and fixtures
including client SDK tests
7) Telemetry just works with tools API because of our trace protocol
decorator


## Test Plan
```
pytest -s -v -k fireworks llama_stack/providers/tests/agents/test_agents.py  \
   --safety-shield=meta-llama/Llama-Guard-3-8B \
   --inference-model=meta-llama/Llama-3.1-8B-Instruct

pytest -s -v -k together  llama_stack/providers/tests/tools/test_tools.py \
   --safety-shield=meta-llama/Llama-Guard-3-8B \
   --inference-model=meta-llama/Llama-3.1-8B-Instruct

LLAMA_STACK_CONFIG="/Users/dineshyv/.llama/distributions/llamastack-together/together-run.yaml" pytest -v tests/client-sdk/agents/test_agents.py
```
run.yaml:
https://gist.github.com/dineshyv/0365845ad325e1c2cab755788ccc5994

Notebook:
https://colab.research.google.com/drive/1ck7hXQxRl6UvT-ijNRZ-gMZxH1G3cN2d?usp=sharing
2025-01-08 19:01:00 -08:00
Xi Yan
a45ce85ec1 change schedule 2025-01-08 17:24:01 -08:00
Xi Yan
6c3b9fa09b back to rc 2025-01-08 17:22:22 -08:00
Xi Yan
3ce9601f9d nightly 2025-01-08 17:20:42 -08:00
Xi Yan
10b136055a remove hash 2025-01-08 17:19:08 -08:00
Xi Yan
8640a30e6a rc? 2025-01-08 17:17:47 -08:00
Xi Yan
8ffdff1c7a rc? 2025-01-08 17:16:42 -08:00