Skip to content

Commit 0b3218e

Browse files
committed
Merge remote-tracking branch 'origin/main' into ai
2 parents 7bcce1f + b0797e4 commit 0b3218e

File tree

94 files changed

+4090
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4090
-233
lines changed

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,16 @@ jobs:
3636
**/requirements*.txt
3737
.pre-commit-config.yaml
3838
39-
# npm ci may fail -
40-
# npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
41-
# npm error Invalid: lock file's [email protected] does not satisfy [email protected]
42-
43-
# - name: Set up Node.js
44-
# uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
45-
# with:
46-
# node-version: '20'
47-
# cache: 'npm'
48-
# cache-dependency-path: 'llama_stack/ui/'
49-
50-
# - name: Install npm dependencies
51-
# run: npm ci
52-
# working-directory: llama_stack/ui
39+
- name: Set up Node.js
40+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
41+
with:
42+
node-version: '20'
43+
cache: 'npm'
44+
cache-dependency-path: 'llama_stack/ui/'
45+
46+
- name: Install npm dependencies
47+
run: npm ci
48+
working-directory: llama_stack/ui
5349

5450
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
5551
continue-on-error: true

.pre-commit-config.yaml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -146,31 +146,13 @@ repos:
146146
pass_filenames: false
147147
require_serial: true
148148
files: ^.github/workflows/.*$
149-
# ui-prettier and ui-eslint are disabled until we can avoid `npm ci`, which is slow and may fail -
150-
# npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
151-
# npm error Invalid: lock file's [email protected] does not satisfy [email protected]
152-
# and until we have infra for installing prettier and next via npm -
153-
# Lint UI code with ESLint.....................................................Failed
154-
# - hook id: ui-eslint
155-
# - exit code: 127
156-
157-
# > next lint --fix --quiet
158-
# sh: line 1: next: command not found
159-
#
160-
# - id: ui-prettier
161-
# name: Format UI code with Prettier
162-
# entry: bash -c 'cd llama_stack/ui && npm ci && npm run format'
163-
# language: system
164-
# files: ^llama_stack/ui/.*\.(ts|tsx)$
165-
# pass_filenames: false
166-
# require_serial: true
167-
# - id: ui-eslint
168-
# name: Lint UI code with ESLint
169-
# entry: bash -c 'cd llama_stack/ui && npm run lint -- --fix --quiet'
170-
# language: system
171-
# files: ^llama_stack/ui/.*\.(ts|tsx)$
172-
# pass_filenames: false
173-
# require_serial: true
149+
- id: ui-linter
150+
name: Format & Lint UI
151+
entry: bash ./scripts/run-ui-linter.sh
152+
language: system
153+
files: ^llama_stack/ui/.*\.(ts|tsx)$
154+
pass_filenames: false
155+
require_serial: true
174156

175157
- id: check-log-usage
176158
name: Ensure 'llama_stack.log' usage for logging

docs/_static/llama-stack-spec.html

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4605,6 +4605,49 @@
46054605
}
46064606
}
46074607
},
4608+
"/v1/inference/rerank": {
4609+
"post": {
4610+
"responses": {
4611+
"200": {
4612+
"description": "RerankResponse with indices sorted by relevance score (descending).",
4613+
"content": {
4614+
"application/json": {
4615+
"schema": {
4616+
"$ref": "#/components/schemas/RerankResponse"
4617+
}
4618+
}
4619+
}
4620+
},
4621+
"400": {
4622+
"$ref": "#/components/responses/BadRequest400"
4623+
},
4624+
"429": {
4625+
"$ref": "#/components/responses/TooManyRequests429"
4626+
},
4627+
"500": {
4628+
"$ref": "#/components/responses/InternalServerError500"
4629+
},
4630+
"default": {
4631+
"$ref": "#/components/responses/DefaultError"
4632+
}
4633+
},
4634+
"tags": [
4635+
"Inference"
4636+
],
4637+
"description": "Rerank a list of documents based on their relevance to a query.",
4638+
"parameters": [],
4639+
"requestBody": {
4640+
"content": {
4641+
"application/json": {
4642+
"schema": {
4643+
"$ref": "#/components/schemas/RerankRequest"
4644+
}
4645+
}
4646+
},
4647+
"required": true
4648+
}
4649+
}
4650+
},
46084651
"/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": {
46094652
"post": {
46104653
"responses": {
@@ -16587,6 +16630,95 @@
1658716630
],
1658816631
"title": "RegisterVectorDbRequest"
1658916632
},
16633+
"RerankRequest": {
16634+
"type": "object",
16635+
"properties": {
16636+
"model": {
16637+
"type": "string",
16638+
"description": "The identifier of the reranking model to use."
16639+
},
16640+
"query": {
16641+
"oneOf": [
16642+
{
16643+
"type": "string"
16644+
},
16645+
{
16646+
"$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam"
16647+
},
16648+
{
16649+
"$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam"
16650+
}
16651+
],
16652+
"description": "The search query to rank items against. Can be a string, text content part, or image content part. The input must not exceed the model's max input token length."
16653+
},
16654+
"items": {
16655+
"type": "array",
16656+
"items": {
16657+
"oneOf": [
16658+
{
16659+
"type": "string"
16660+
},
16661+
{
16662+
"$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam"
16663+
},
16664+
{
16665+
"$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam"
16666+
}
16667+
]
16668+
},
16669+
"description": "List of items to rerank. Each item can be a string, text content part, or image content part. Each input must not exceed the model's max input token length."
16670+
},
16671+
"max_num_results": {
16672+
"type": "integer",
16673+
"description": "(Optional) Maximum number of results to return. Default: returns all."
16674+
}
16675+
},
16676+
"additionalProperties": false,
16677+
"required": [
16678+
"model",
16679+
"query",
16680+
"items"
16681+
],
16682+
"title": "RerankRequest"
16683+
},
16684+
"RerankData": {
16685+
"type": "object",
16686+
"properties": {
16687+
"index": {
16688+
"type": "integer",
16689+
"description": "The original index of the document in the input list"
16690+
},
16691+
"relevance_score": {
16692+
"type": "number",
16693+
"description": "The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance."
16694+
}
16695+
},
16696+
"additionalProperties": false,
16697+
"required": [
16698+
"index",
16699+
"relevance_score"
16700+
],
16701+
"title": "RerankData",
16702+
"description": "A single rerank result from a reranking response."
16703+
},
16704+
"RerankResponse": {
16705+
"type": "object",
16706+
"properties": {
16707+
"data": {
16708+
"type": "array",
16709+
"items": {
16710+
"$ref": "#/components/schemas/RerankData"
16711+
},
16712+
"description": "List of rerank result objects, sorted by relevance score (descending)"
16713+
}
16714+
},
16715+
"additionalProperties": false,
16716+
"required": [
16717+
"data"
16718+
],
16719+
"title": "RerankResponse",
16720+
"description": "Response from a reranking request."
16721+
},
1659016722
"ResumeAgentTurnRequest": {
1659116723
"type": "object",
1659216724
"properties": {

docs/_static/llama-stack-spec.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,6 +3264,37 @@ paths:
32643264
schema:
32653265
$ref: '#/components/schemas/QueryTracesRequest'
32663266
required: true
3267+
/v1/inference/rerank:
3268+
post:
3269+
responses:
3270+
'200':
3271+
description: >-
3272+
RerankResponse with indices sorted by relevance score (descending).
3273+
content:
3274+
application/json:
3275+
schema:
3276+
$ref: '#/components/schemas/RerankResponse'
3277+
'400':
3278+
$ref: '#/components/responses/BadRequest400'
3279+
'429':
3280+
$ref: >-
3281+
#/components/responses/TooManyRequests429
3282+
'500':
3283+
$ref: >-
3284+
#/components/responses/InternalServerError500
3285+
default:
3286+
$ref: '#/components/responses/DefaultError'
3287+
tags:
3288+
- Inference
3289+
description: >-
3290+
Rerank a list of documents based on their relevance to a query.
3291+
parameters: []
3292+
requestBody:
3293+
content:
3294+
application/json:
3295+
schema:
3296+
$ref: '#/components/schemas/RerankRequest'
3297+
required: true
32673298
/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume:
32683299
post:
32693300
responses:
@@ -12337,6 +12368,76 @@ components:
1233712368
- vector_db_id
1233812369
- embedding_model
1233912370
title: RegisterVectorDbRequest
12371+
RerankRequest:
12372+
type: object
12373+
properties:
12374+
model:
12375+
type: string
12376+
description: >-
12377+
The identifier of the reranking model to use.
12378+
query:
12379+
oneOf:
12380+
- type: string
12381+
- $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam'
12382+
- $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam'
12383+
description: >-
12384+
The search query to rank items against. Can be a string, text content
12385+
part, or image content part. The input must not exceed the model's max
12386+
input token length.
12387+
items:
12388+
type: array
12389+
items:
12390+
oneOf:
12391+
- type: string
12392+
- $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam'
12393+
- $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam'
12394+
description: >-
12395+
List of items to rerank. Each item can be a string, text content part,
12396+
or image content part. Each input must not exceed the model's max input
12397+
token length.
12398+
max_num_results:
12399+
type: integer
12400+
description: >-
12401+
(Optional) Maximum number of results to return. Default: returns all.
12402+
additionalProperties: false
12403+
required:
12404+
- model
12405+
- query
12406+
- items
12407+
title: RerankRequest
12408+
RerankData:
12409+
type: object
12410+
properties:
12411+
index:
12412+
type: integer
12413+
description: >-
12414+
The original index of the document in the input list
12415+
relevance_score:
12416+
type: number
12417+
description: >-
12418+
The relevance score from the model output. Values are inverted when applicable
12419+
so that higher scores indicate greater relevance.
12420+
additionalProperties: false
12421+
required:
12422+
- index
12423+
- relevance_score
12424+
title: RerankData
12425+
description: >-
12426+
A single rerank result from a reranking response.
12427+
RerankResponse:
12428+
type: object
12429+
properties:
12430+
data:
12431+
type: array
12432+
items:
12433+
$ref: '#/components/schemas/RerankData'
12434+
description: >-
12435+
List of rerank result objects, sorted by relevance score (descending)
12436+
additionalProperties: false
12437+
required:
12438+
- data
12439+
title: RerankResponse
12440+
description: Response from a reranking request.
1234012441
ResumeAgentTurnRequest:
1234112442
type: object
1234212443
properties:

docs/source/providers/files/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ This section contains documentation for all available providers for the **files*
1010
:maxdepth: 1
1111
1212
inline_localfs
13+
remote_s3
1314
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# remote::s3
2+
3+
## Description
4+
5+
AWS S3-based file storage provider for scalable cloud file management with metadata persistence.
6+
7+
## Configuration
8+
9+
| Field | Type | Required | Default | Description |
10+
|-------|------|----------|---------|-------------|
11+
| `bucket_name` | `<class 'str'>` | No | | S3 bucket name to store files |
12+
| `region` | `<class 'str'>` | No | us-east-1 | AWS region where the bucket is located |
13+
| `aws_access_key_id` | `str \| None` | No | | AWS access key ID (optional if using IAM roles) |
14+
| `aws_secret_access_key` | `str \| None` | No | | AWS secret access key (optional if using IAM roles) |
15+
| `endpoint_url` | `str \| None` | No | | Custom S3 endpoint URL (for MinIO, LocalStack, etc.) |
16+
| `auto_create_bucket` | `<class 'bool'>` | No | False | Automatically create the S3 bucket if it doesn't exist |
17+
| `metadata_store` | `utils.sqlstore.sqlstore.SqliteSqlStoreConfig \| utils.sqlstore.sqlstore.PostgresSqlStoreConfig` | No | sqlite | SQL store configuration for file metadata |
18+
19+
## Sample Configuration
20+
21+
```yaml
22+
bucket_name: ${env.S3_BUCKET_NAME}
23+
region: ${env.AWS_REGION:=us-east-1}
24+
aws_access_key_id: ${env.AWS_ACCESS_KEY_ID:=}
25+
aws_secret_access_key: ${env.AWS_SECRET_ACCESS_KEY:=}
26+
endpoint_url: ${env.S3_ENDPOINT_URL:=}
27+
auto_create_bucket: ${env.S3_AUTO_CREATE_BUCKET:=false}
28+
metadata_store:
29+
type: sqlite
30+
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/dummy}/s3_files_metadata.db
31+
32+
```
33+

0 commit comments

Comments
 (0)