feat: add s3 provider to files API

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-04-01 11:46:42 +02:00
parent e3ad17ec5e
commit 749cbcca31
No known key found for this signature in database
17 changed files with 614 additions and 132 deletions

View file

@ -568,11 +568,11 @@
"get": {
"responses": {
"200": {
"description": "OK",
"description": "PaginatedResponse with the list of buckets",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListBucketResponse"
"$ref": "#/components/schemas/PaginatedResponse"
}
}
}
@ -596,11 +596,21 @@
"description": "List all buckets.",
"parameters": [
{
"name": "bucket",
"name": "page",
"in": "query",
"required": true,
"description": "The page number (1-based). If None, starts from first page.",
"required": false,
"schema": {
"type": "string"
"type": "integer"
}
},
{
"name": "size",
"in": "query",
"description": "Number of items per page. If None or -1, returns all items.",
"required": false,
"schema": {
"type": "integer"
}
}
]
@ -1850,7 +1860,7 @@
"parameters": []
}
},
"/v1/files/session:{upload_id}": {
"/v1/files/session/{upload_id}": {
"get": {
"responses": {
"200": {
@ -2631,11 +2641,11 @@
"get": {
"responses": {
"200": {
"description": "OK",
"description": "PaginatedResponse with the list of files",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListFileResponse"
"$ref": "#/components/schemas/PaginatedResponse"
}
}
}
@ -2666,6 +2676,24 @@
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"description": "The page number (1-based). If None, starts from first page.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "size",
"in": "query",
"description": "Number of items per page. If None or -1, returns all items.",
"required": false,
"schema": {
"type": "integer"
}
}
]
}
@ -9085,37 +9113,6 @@
],
"title": "Job"
},
"BucketResponse": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name"
],
"title": "BucketResponse"
},
"ListBucketResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BucketResponse"
},
"description": "List of FileResponse entries"
}
},
"additionalProperties": false,
"required": [
"data"
],
"title": "ListBucketResponse",
"description": "Response representing a list of file entries."
},
"ListBenchmarksResponse": {
"type": "object",
"properties": {
@ -9148,24 +9145,6 @@
],
"title": "ListDatasetsResponse"
},
"ListFileResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FileResponse"
},
"description": "List of FileResponse entries"
}
},
"additionalProperties": false,
"required": [
"data"
],
"title": "ListFileResponse",
"description": "Response representing a list of file entries."
},
"ListModelsResponse": {
"type": "object",
"properties": {

View file

@ -379,11 +379,12 @@ paths:
get:
responses:
'200':
description: OK
description: >-
PaginatedResponse with the list of buckets
content:
application/json:
schema:
$ref: '#/components/schemas/ListBucketResponse'
$ref: '#/components/schemas/PaginatedResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -398,11 +399,20 @@ paths:
- Files
description: List all buckets.
parameters:
- name: bucket
- name: page
in: query
required: true
description: >-
The page number (1-based). If None, starts from first page.
required: false
schema:
type: string
type: integer
- name: size
in: query
description: >-
Number of items per page. If None or -1, returns all items.
required: false
schema:
type: integer
post:
responses:
'200':
@ -1261,7 +1271,7 @@ paths:
- PostTraining (Coming Soon)
description: ''
parameters: []
/v1/files/session:{upload_id}:
/v1/files/session/{upload_id}:
get:
responses:
'200':
@ -1816,11 +1826,11 @@ paths:
get:
responses:
'200':
description: OK
description: PaginatedResponse with the list of files
content:
application/json:
schema:
$ref: '#/components/schemas/ListFileResponse'
$ref: '#/components/schemas/PaginatedResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -1841,6 +1851,20 @@ paths:
required: true
schema:
type: string
- name: page
in: query
description: >-
The page number (1-based). If None, starts from first page.
required: false
schema:
type: integer
- name: size
in: query
description: >-
Number of items per page. If None or -1, returns all items.
required: false
schema:
type: integer
/v1/models:
get:
responses:
@ -6277,29 +6301,6 @@ components:
- job_id
- status
title: Job
BucketResponse:
type: object
properties:
name:
type: string
additionalProperties: false
required:
- name
title: BucketResponse
ListBucketResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/BucketResponse'
description: List of FileResponse entries
additionalProperties: false
required:
- data
title: ListBucketResponse
description: >-
Response representing a list of file entries.
ListBenchmarksResponse:
type: object
properties:
@ -6322,20 +6323,6 @@ components:
required:
- data
title: ListDatasetsResponse
ListFileResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/FileResponse'
description: List of FileResponse entries
additionalProperties: false
required:
- data
title: ListFileResponse
description: >-
Response representing a list of file entries.
ListModelsResponse:
type: object
properties:

View file

@ -18,6 +18,7 @@ The `llamastack/distribution-ollama` distribution consists of the following prov
| agents | `inline::meta-reference` |
| datasetio | `remote::huggingface`, `inline::localfs` |
| eval | `inline::meta-reference` |
| files | `remote::s3` |
| inference | `remote::ollama` |
| safety | `inline::llama-guard` |
| scoring | `inline::basic`, `inline::llm-as-judge`, `inline::braintrust` |
@ -36,6 +37,12 @@ The following environment variables can be configured:
- `OLLAMA_URL`: URL of the Ollama server (default: `http://127.0.0.1:11434`)
- `INFERENCE_MODEL`: Inference model loaded into the Ollama server (default: `meta-llama/Llama-3.2-3B-Instruct`)
- `SAFETY_MODEL`: Safety model loaded into the Ollama server (default: `meta-llama/Llama-Guard-3-1B`)
- `AWS_ACCESS_KEY_ID`: AWS access key ID for S3 access (default: ``)
- `AWS_SECRET_ACCESS_KEY`: AWS secret access key for S3 access (default: ``)
- `AWS_REGION_NAME`: AWS region name for S3 access (default: ``)
- `AWS_ENDPOINT_URL`: AWS endpoint URL for S3 access (for custom endpoints) (default: ``)
- `AWS_BUCKET_NAME`: AWS bucket name for S3 access (default: ``)
- `AWS_VERIFY_TLS`: Whether to verify TLS for S3 connections (default: `true`)
## Setting up Ollama server