llama-stack-mirror/scripts
Matthew Farrellee 914c7be288
feat: add batches API with OpenAI compatibility (with inference replay) (#3162)
Add complete batches API implementation with protocol, providers, and
tests:

Core Infrastructure:
- Add batches API protocol using OpenAI Batch types directly
- Add Api.batches enum value and protocol mapping in resolver
- Add OpenAI "batch" file purpose support
- Include proper error handling (ConflictError, ResourceNotFoundError)

Reference Provider:
- Add ReferenceBatchesImpl with full CRUD operations (create, retrieve,
cancel, list)
- Implement background batch processing with configurable concurrency
- Add SQLite KVStore backend for persistence
- Support /v1/chat/completions endpoint with request validation

Comprehensive Test Suite:
- Add unit tests for provider implementation with validation
- Add integration tests for end-to-end batch processing workflows
- Add error handling tests for validation, malformed inputs, and edge
cases

Configuration:
- Add max_concurrent_batches and max_concurrent_requests_per_batch
options
- Add provider documentation with sample configurations

Test with -

```
$ uv run llama stack build --image-type venv --providers inference=YOU_PICK,files=inline::localfs,batches=inline::reference --run &
$ LLAMA_STACK_CONFIG=http://localhost:8321 uv run pytest tests/unit/providers/batches tests/integration/batches --text-model YOU_PICK
```

addresses #3066

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
2025-08-15 15:34:15 -07:00
..
check-init-py.sh ci: vector_io provider integration tests (#2537) 2025-06-26 17:04:32 -07:00
check-workflows-use-hashes.sh fix: update check-workflows-use-hashes to use github error format (#2875) 2025-07-24 17:41:17 +02:00
distro_codegen.py chore: rename templates to distributions (#3035) 2025-08-04 11:34:17 -07:00
gen-changelog.py chore: enable ruff for ./scripts too (#1643) 2025-03-18 12:17:21 -07:00
gen-ci-docs.py chore: Remove coverage badge from README.md (#2976) 2025-07-31 09:21:30 -07:00
generate_prompt_format.py chore: standardize model not found error (#2964) 2025-07-30 12:19:53 -07:00
install.sh feat(starter)!: simplify starter distro; litellm model registry changes (#2916) 2025-07-25 15:02:04 -07:00
integration-tests.sh fix(ci): skip batches directory for library client testing 2025-08-15 15:30:03 -07:00
provider_codegen.py feat: add batches API with OpenAI compatibility (with inference replay) (#3162) 2025-08-15 15:34:15 -07:00
setup_telemetry.sh feat: improve telemetry (#2590) 2025-07-04 17:29:09 +02:00
unit-tests.sh fix: Fix unit tests CI and failing tests (#2928) 2025-07-28 10:07:26 -07:00