> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/more-in-this-section-9/type-models.md).

# Type models (Pydantic)

SDK Pydantic models — exhaustive list of types exported from the layerlens package.

The SDK returns Pydantic models throughout. Top-level exports — verified from `src/layerlens/__init__.py`:

## Models exported from `layerlens`

```python
from layerlens import (
 Judge,
 JudgeVersion,
 JudgeSnapshot,
 Trace,
 TraceEvaluation,
 TraceEvaluationStep,
 TraceEvaluationResult,
 TraceEvaluationStatus,
 TraceEvaluationSummary,
 TraceWithEvaluations,
 JudgeOptimizationRun,
 OptimizationBudget,
 OptimizationRunStatus,
 BenchmarkPrompt,
 BenchmarkPromptsResponse,
 PublicModelDetail,
 PublicBenchmarkDetail,
 PublicModelsListResponse,
 PublicBenchmarksListResponse,
 ComparisonResult,
 ComparisonResponse,
 Integration,
)
```

## Type by resource

| Resource                       | Returned types                                                                                                                               |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `client.judges.*`              | `Judge`, `JudgeVersion`, `JudgeSnapshot`, plus list responses with `.judges`, `.total_count`                                                 |
| `client.traces.*`              | `Trace`, plus `TracesResponse` with `.traces`, `.total_count`, `.count`                                                                      |
| `client.trace_evaluations.*`   | `TraceEvaluation`, `TraceEvaluationStep`, `TraceEvaluationResult`, `TraceEvaluationSummary`, `TraceEvaluationStatus`, `TraceWithEvaluations` |
| `client.judge_optimizations.*` | `JudgeOptimizationRun`, `OptimizationBudget`, `OptimizationRunStatus`                                                                        |
| `client.evaluations.*`         | `Evaluation` and result types (drawn from the SDK; check `result.accuracy`, `result.is_success`, `result.status`)                            |
| `client.benchmarks.*`          | `BenchmarkPrompt`, `BenchmarkPromptsResponse`                                                                                                |
| `client.public.models.*`       | `PublicModelDetail`, `PublicModelsListResponse`                                                                                              |
| `client.public.benchmarks.*`   | `PublicBenchmarkDetail`, `PublicBenchmarksListResponse`                                                                                      |
| `client.public.comparisons.*`  | `ComparisonResult`, `ComparisonResponse`                                                                                                     |
| `client.integrations.*`        | `Integration`                                                                                                                                |
| `client.results.*`             | Result types — fields depend on evaluation kind (see [Evaluations](/more-in-this-section-9/evaluations-1.md))                                |

## Common patterns

All Pydantic models support:

```python
result = client.evaluations.wait_for_completion(evaluation)
result.dict() # Python dict
result.json() # JSON string
result.accuracy # field access
result.is_success # boolean helper on Evaluation
```

For Pydantic v1 / v2 compatibility, the SDK includes a dual-compat shim (`layerlens._compat.pydantic`). Both `model_dump()` (v2) and `dict()` (v1) work.

## IDE support

The SDK ships with PEP 561 inline type annotations. Pylance, Pyright, mypy `--strict`, and PyCharm all introspect types correctly. See [Type stubs and IDE support](/13.1-sdk-and-apis/type-stubs.md).

## Type access for fields not in the top-level export

If a method returns a type not exported from the top-level package (e.g. internal response wrappers), import from `layerlens.models`:

```python
from layerlens.models import (
 JudgesResponse,
 TracesResponse,
 EvaluationsResponse,
)
```

## See also

* [Type stubs and IDE support](/13.1-sdk-and-apis/type-stubs.md)
* [Errors](/more-in-this-section-9/errors-1.md) — exception type hierarchy
* [Source: `stratix-python/src/layerlens/__init__.py`](https://github.com/layerlens/stratix-python/blob/main/src/layerlens/__init__.py)
