Skip to content

Commit 28e7f35

Browse files
committed
feat: add s3 provider to files API
Signed-off-by: Sébastien Han <[email protected]>
1 parent db21eab commit 28e7f35

File tree

13 files changed

+456
-131
lines changed

13 files changed

+456
-131
lines changed

docs/_static/llama-stack-spec.html

Lines changed: 36 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,11 @@
568568
"get": {
569569
"responses": {
570570
"200": {
571-
"description": "OK",
571+
"description": "PaginatedResponse with the list of buckets",
572572
"content": {
573573
"application/json": {
574574
"schema": {
575-
"$ref": "#/components/schemas/ListBucketResponse"
575+
"$ref": "#/components/schemas/PaginatedResponse"
576576
}
577577
}
578578
}
@@ -596,11 +596,21 @@
596596
"description": "List all buckets.",
597597
"parameters": [
598598
{
599-
"name": "bucket",
599+
"name": "page",
600600
"in": "query",
601-
"required": true,
601+
"description": "The page number (1-based). If None, starts from first page.",
602+
"required": false,
602603
"schema": {
603-
"type": "string"
604+
"type": "integer"
605+
}
606+
},
607+
{
608+
"name": "size",
609+
"in": "query",
610+
"description": "Number of items per page. If None or -1, returns all items.",
611+
"required": false,
612+
"schema": {
613+
"type": "integer"
604614
}
605615
}
606616
]
@@ -1850,7 +1860,7 @@
18501860
"parameters": []
18511861
}
18521862
},
1853-
"/v1/files/session:{upload_id}": {
1863+
"/v1/files/session/{upload_id}": {
18541864
"get": {
18551865
"responses": {
18561866
"200": {
@@ -2631,11 +2641,11 @@
26312641
"get": {
26322642
"responses": {
26332643
"200": {
2634-
"description": "OK",
2644+
"description": "PaginatedResponse with the list of files",
26352645
"content": {
26362646
"application/json": {
26372647
"schema": {
2638-
"$ref": "#/components/schemas/ListFileResponse"
2648+
"$ref": "#/components/schemas/PaginatedResponse"
26392649
}
26402650
}
26412651
}
@@ -2666,6 +2676,24 @@
26662676
"schema": {
26672677
"type": "string"
26682678
}
2679+
},
2680+
{
2681+
"name": "page",
2682+
"in": "query",
2683+
"description": "The page number (1-based). If None, starts from first page.",
2684+
"required": false,
2685+
"schema": {
2686+
"type": "integer"
2687+
}
2688+
},
2689+
{
2690+
"name": "size",
2691+
"in": "query",
2692+
"description": "Number of items per page. If None or -1, returns all items.",
2693+
"required": false,
2694+
"schema": {
2695+
"type": "integer"
2696+
}
26692697
}
26702698
]
26712699
}
@@ -9085,37 +9113,6 @@
90859113
],
90869114
"title": "Job"
90879115
},
9088-
"BucketResponse": {
9089-
"type": "object",
9090-
"properties": {
9091-
"name": {
9092-
"type": "string"
9093-
}
9094-
},
9095-
"additionalProperties": false,
9096-
"required": [
9097-
"name"
9098-
],
9099-
"title": "BucketResponse"
9100-
},
9101-
"ListBucketResponse": {
9102-
"type": "object",
9103-
"properties": {
9104-
"data": {
9105-
"type": "array",
9106-
"items": {
9107-
"$ref": "#/components/schemas/BucketResponse"
9108-
},
9109-
"description": "List of FileResponse entries"
9110-
}
9111-
},
9112-
"additionalProperties": false,
9113-
"required": [
9114-
"data"
9115-
],
9116-
"title": "ListBucketResponse",
9117-
"description": "Response representing a list of file entries."
9118-
},
91199116
"ListBenchmarksResponse": {
91209117
"type": "object",
91219118
"properties": {
@@ -9148,24 +9145,6 @@
91489145
],
91499146
"title": "ListDatasetsResponse"
91509147
},
9151-
"ListFileResponse": {
9152-
"type": "object",
9153-
"properties": {
9154-
"data": {
9155-
"type": "array",
9156-
"items": {
9157-
"$ref": "#/components/schemas/FileResponse"
9158-
},
9159-
"description": "List of FileResponse entries"
9160-
}
9161-
},
9162-
"additionalProperties": false,
9163-
"required": [
9164-
"data"
9165-
],
9166-
"title": "ListFileResponse",
9167-
"description": "Response representing a list of file entries."
9168-
},
91699148
"ListModelsResponse": {
91709149
"type": "object",
91719150
"properties": {

docs/_static/llama-stack-spec.yaml

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,12 @@ paths:
379379
get:
380380
responses:
381381
'200':
382-
description: OK
382+
description: >-
383+
PaginatedResponse with the list of buckets
383384
content:
384385
application/json:
385386
schema:
386-
$ref: '#/components/schemas/ListBucketResponse'
387+
$ref: '#/components/schemas/PaginatedResponse'
387388
'400':
388389
$ref: '#/components/responses/BadRequest400'
389390
'429':
@@ -398,11 +399,20 @@ paths:
398399
- Files
399400
description: List all buckets.
400401
parameters:
401-
- name: bucket
402+
- name: page
402403
in: query
403-
required: true
404+
description: >-
405+
The page number (1-based). If None, starts from first page.
406+
required: false
404407
schema:
405-
type: string
408+
type: integer
409+
- name: size
410+
in: query
411+
description: >-
412+
Number of items per page. If None or -1, returns all items.
413+
required: false
414+
schema:
415+
type: integer
406416
post:
407417
responses:
408418
'200':
@@ -1261,7 +1271,7 @@ paths:
12611271
- PostTraining (Coming Soon)
12621272
description: ''
12631273
parameters: []
1264-
/v1/files/session:{upload_id}:
1274+
/v1/files/session/{upload_id}:
12651275
get:
12661276
responses:
12671277
'200':
@@ -1816,11 +1826,11 @@ paths:
18161826
get:
18171827
responses:
18181828
'200':
1819-
description: OK
1829+
description: PaginatedResponse with the list of files
18201830
content:
18211831
application/json:
18221832
schema:
1823-
$ref: '#/components/schemas/ListFileResponse'
1833+
$ref: '#/components/schemas/PaginatedResponse'
18241834
'400':
18251835
$ref: '#/components/responses/BadRequest400'
18261836
'429':
@@ -1841,6 +1851,20 @@ paths:
18411851
required: true
18421852
schema:
18431853
type: string
1854+
- name: page
1855+
in: query
1856+
description: >-
1857+
The page number (1-based). If None, starts from first page.
1858+
required: false
1859+
schema:
1860+
type: integer
1861+
- name: size
1862+
in: query
1863+
description: >-
1864+
Number of items per page. If None or -1, returns all items.
1865+
required: false
1866+
schema:
1867+
type: integer
18441868
/v1/models:
18451869
get:
18461870
responses:
@@ -6277,29 +6301,6 @@ components:
62776301
- job_id
62786302
- status
62796303
title: Job
6280-
BucketResponse:
6281-
type: object
6282-
properties:
6283-
name:
6284-
type: string
6285-
additionalProperties: false
6286-
required:
6287-
- name
6288-
title: BucketResponse
6289-
ListBucketResponse:
6290-
type: object
6291-
properties:
6292-
data:
6293-
type: array
6294-
items:
6295-
$ref: '#/components/schemas/BucketResponse'
6296-
description: List of FileResponse entries
6297-
additionalProperties: false
6298-
required:
6299-
- data
6300-
title: ListBucketResponse
6301-
description: >-
6302-
Response representing a list of file entries.
63036304
ListBenchmarksResponse:
63046305
type: object
63056306
properties:
@@ -6322,20 +6323,6 @@ components:
63226323
required:
63236324
- data
63246325
title: ListDatasetsResponse
6325-
ListFileResponse:
6326-
type: object
6327-
properties:
6328-
data:
6329-
type: array
6330-
items:
6331-
$ref: '#/components/schemas/FileResponse'
6332-
description: List of FileResponse entries
6333-
additionalProperties: false
6334-
required:
6335-
- data
6336-
title: ListFileResponse
6337-
description: >-
6338-
Response representing a list of file entries.
63396326
ListModelsResponse:
63406327
type: object
63416328
properties:

docs/source/distributions/self_hosted_distro/ollama.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The `llamastack/distribution-ollama` distribution consists of the following prov
1818
| agents | `inline::meta-reference` |
1919
| datasetio | `remote::huggingface`, `inline::localfs` |
2020
| eval | `inline::meta-reference` |
21+
| files | `remote::s3` |
2122
| inference | `remote::ollama` |
2223
| safety | `inline::llama-guard` |
2324
| scoring | `inline::basic`, `inline::llm-as-judge`, `inline::braintrust` |
@@ -36,6 +37,12 @@ The following environment variables can be configured:
3637
- `OLLAMA_URL`: URL of the Ollama server (default: `http://127.0.0.1:11434`)
3738
- `INFERENCE_MODEL`: Inference model loaded into the Ollama server (default: `meta-llama/Llama-3.2-3B-Instruct`)
3839
- `SAFETY_MODEL`: Safety model loaded into the Ollama server (default: `meta-llama/Llama-Guard-3-1B`)
40+
- `AWS_ACCESS_KEY_ID`: AWS access key ID for S3 access (default: ``)
41+
- `AWS_SECRET_ACCESS_KEY`: AWS secret access key for S3 access (default: ``)
42+
- `AWS_REGION_NAME`: AWS region name for S3 access (default: ``)
43+
- `AWS_ENDPOINT_URL`: AWS endpoint URL for S3 access (for custom endpoints) (default: ``)
44+
- `AWS_BUCKET_NAME`: AWS bucket name for S3 access (default: ``)
45+
- `AWS_VERIFY_TLS`: Whether to verify TLS for S3 connections (default: `true`)
3946

4047

4148
## Setting up Ollama server

0 commit comments

Comments
 (0)