For the complete documentation index, see llms.txt. This page is also available as Markdown.

Models and Benchmarks

Browse, filter, create custom/smart, and manage models and benchmarks.

Examples for browsing, filtering, creating, and managing models and benchmarks using the LayerLens Python SDK.

Filtering Models

import asyncio

from layerlens import AsyncStratix

async def main():
 client = AsyncStratix()

 # --- Filter by name
 model_name = "gpt-4o"
 models = await client.models.get(name=model_name)
 print(f"Found {len(models)} models with name {model_name}")

 # --- Filter by company
 company_names = ["openai", "anthropic"]
 models = await client.models.get(companies=company_names)
 print(f"Found {len(models)} models with companies {company_names}")

 # --- Filter by region
 region_names = ["usa"]
 models = await client.models.get(regions=region_names)
 print(f"Found {len(models)} models with regions {region_names}")

 # --- Filter by categories
 categories = ["Open-Source"]
 models = await client.models.get(categories=categories)
 print(f"Found {len(models)} open-source models")

 # --- Filter by key
 models = await client.models.get(key="gpt-4")
 print(f"Found {len(models)} models matching key 'gpt-4'")

 # --- Filter by license
 licenses = ["apache-2.0"]
 models = await client.models.get(licenses=licenses)
 print(f"Found {len(models)} models with license {licenses}")

 # --- Filter by type
 model_type = "public"
 models = await client.models.get(type=model_type)
 print(f"Found {len(models)} models with type {model_type}")

if __name__ == "__main__":
 asyncio.run(main())

Filtering Benchmarks

Creating a Custom Model

Custom models let you evaluate any model accessible via an OpenAI-compatible chat completions endpoint.

Creating a Custom Benchmark

Custom benchmarks are created from JSONL files with input and truth fields.

JSONL File Format

Each line should be a JSON object:

Optional field: subset (for grouping prompts into categories).

Creating a Smart Benchmark

Smart benchmarks use AI to automatically generate benchmark prompts from uploaded documents. Supported file types: .txt, .pdf, .html, .docx, .csv, .json, .jsonl, .parquet.

Managing Project Models and Benchmarks

Add and remove public models and benchmarks from your project.

See Also

Last updated

Was this helpful?