Import OpenAIChatCompletionChunk from llama_stack.apis.inference
instead of aliasing from openai package to match parent class signature.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Refactor embeddings API calls to avoid NotGiven/Omit type incompatibility
by conditionally building kwargs dict with only non-None parameters.
- openai_mixin.py: Build kwargs conditionally for embeddings.create()
- gemini.py: Apply same pattern + add Any import
This approach avoids type:ignore comments by not passing NOT_GIVEN sentinel
values that conflict with Omit type annotations in OpenAI SDK.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- routes.py: Use type ignore for intentional None endpoint
- routes.py: Handle optional route.methods with fallback to empty list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- batches.py: Fix bytes/memoryview union type narrowing issue
- encoder_utils.py: Add type annotation for masks_list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- batches.py: Fix 6 cascading errors from body variable shadowing
- together.py: Add type casts for Together API integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes mypy type errors across provider utilities and testing infrastructure (Phase 2e):
- mcp.py (2 errors fixed):
- Cast sse_client to Any to handle incompatible signatures with streamablehttp_client
- Wrap ImageContent data in _URLOrData(data=...) for proper ImageContentItem construction
- batches.py (1 error fixed):
- Rename walrus operator variable from `body` to `request_body` to avoid shadowing
the file content `body` variable (bytes|memoryview) defined earlier in scope
- api_recorder.py (1 error fixed):
- Cast Pydantic field annotation assignment to proper type when monkey-patching
OpenAI CompletionChoice model to accept None in finish_reason
Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes type errors across 4 model implementation files (Phase 2d):
- image_transform.py: Fix return type annotations and variable shadowing
- Changed find_supported_resolutions return type from Tensor to list[tuple[int, int]]
- Changed resize_without_distortion parameter/return from Tensor to Image.Image
- Use separate variable names for list vs tensor (possible_resolutions_list/tensor)
- checkpoint.py: Replace deprecated torch.BFloat16Tensor usage
- Use torch.set_default_dtype(torch.bfloat16) instead of deprecated tensor types
- Rename ckpt_paths to ckpt_paths_array to avoid variable shadowing
- hadamard_utils.py: Add type assertion for nn.Linear
- Assert isinstance check to narrow type from Module to Linear before accessing in_features
- encoder_utils.py: Fix variable shadowing
- Use masks_list for list accumulation, masks for final Tensor result
Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Resolves typing issues across provider utilities:
**MongoDB (6 errors fixed):**
- Fix AsyncMongoClient parameter dict unpacking by building typed dict with None filtering
- Fix AsyncCursor synchronous iteration - use async for loop
**Batches (1 error fixed):**
- Handle memoryview|bytes union type for file content decoding
**Auth Providers (4 errors fixed):**
- Add missing Any import
- Ensure JWKS URI is not None with validation
- Only pass lifespan parameter when configured (let library use its default)
- Conditionally build httpx post kwargs to avoid passing None for auth
Fixes 11 mypy type errors in provider utility layer.
Fix all 7 mypy type checking errors in SQLAlchemy store implementation without using suppressions.
**Changes:**
- Add `cast()` import for type assertions
- Use `cast(ColumnElement[Any], ...)` for all comparison operators in `_build_where_expr()`
- Handles ==, >, <, >=, <= operators
- Remove unnecessary `rowcount` check before iteration
- SQLAlchemy Result can be iterated directly
- Empty results yield empty list naturally
**Errors fixed:**
- 6 `no-any-return` errors in _build_where_expr (comparison operators)
- 1 `attr-defined` error (Result.rowcount)
**Testing:**
```bash
uv run mypy src/llama_stack/providers/utils/sqlstore/sqlalchemy_sqlstore.py
# Success: no issues found
```
Fix all 11 mypy errors in telemetry.py without using suppressions:
**Changes:**
- Add type aliases for OpenTelemetry attribute types (AttributeValue, Attributes)
- Create `_clean_attributes()` helper to filter None values from attribute dicts
- Use `cast()` for TracerProvider methods (add_span_processor, force_flush)
- Use `cast()` for metric creation methods returning from global storage
- Fix variable reuse by renaming `span` to `end_span` in SpanEndPayload branch
- Add None check for parent_span before set_span_in_context
**Errors fixed:**
- TracerProvider attribute access (2 errors)
- Counter/UpDownCounter/ObservableGauge return types (3 errors)
- Attribute dict type mismatches (4 errors)
- Span assignment type conflicts (2 errors)
This eliminates all mypy errors in the telemetry module.
# What does this PR do?
add provider-data key passing support to Cerebras, Databricks, NVIDIA
and RunPod
also, added missing tests for Fireworks, Anthropic, Gemini, SambaNova,
and vLLM
addresses #3517
## Test Plan
ci w/ new tests
---------
Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
Migrates package structure to src/ layout following Python packaging
best practices.
All code moved from `llama_stack/` to `src/llama_stack/`. Public API
unchanged - imports remain `import llama_stack.*`.
Updated build configs, pre-commit hooks, scripts, and GitHub workflows
accordingly. All hooks pass, package builds cleanly.
**Developer note**: Reinstall after pulling: `pip install -e .`