-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: (TESTING) add batches API with OpenAI compatibility (#3088) #3153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 llamastack#3066
opening this to see if this re-records |
@mattf FYI these are the same failures I see locally when recording or replaying |
I added the label now, lets see |
Failed. My workflow sucks. Let me look into it in a bit. |
which is just the basic checkout mechanism without a ref |
@cdoern the important issue is that you want to be able to push back to the ref. That needs you to specify the |
OK I learnt a few things. This thing is only possible if:
for now, maybe we just need to do this from the maintainers, or have a simple script which anyone can run locally themselves. ( |
I can run the recordings locally, the error is the same as the replay ones here. |
will keep digging |
Closing this, will take over Matt's PR and commit appropriately. |
What does this PR do?
Add complete batches API implementation with protocol, providers, and tests:
Core Infrastructure:
Reference Provider:
Comprehensive Test Suite:
Configuration:
Test Plan
Test with -
addresses #3066