From 0232361d778a28175816d637c0a310c35237db54 Mon Sep 17 00:00:00 2001 From: m-peko Date: Fri, 27 Feb 2026 08:56:37 +0100 Subject: [PATCH 1/3] Fix publish workflows --- .github/workflows/publish-sdk.yaml | 16 +++++++++++++--- .github/workflows/publish-to-aws.yaml | 11 ++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-sdk.yaml b/.github/workflows/publish-sdk.yaml index a56b028..317c987 100644 --- a/.github/workflows/publish-sdk.yaml +++ b/.github/workflows/publish-sdk.yaml @@ -1,5 +1,5 @@ # This workflow is used to publish the Python SDK to the actual PyPI. -# It is triggered by a tag push, and will only publish if the tag is valid. +# It is triggered by a tag push or manually, and will only publish if the tag is valid. # The tag must match the format v*.*.* name: Publish Python SDK @@ -8,6 +8,12 @@ on: push: tags: - "v*.*.*" # Trigger on version tags like v0.1.0 etc. + workflow_dispatch: + inputs: + release_tag: + description: "Release tag to publish (e.g. v1.2.0). Must match a tag that already exists." + required: true + type: string jobs: validate: @@ -21,9 +27,13 @@ jobs: fetch-depth: 0 # Fetch all history for checking branch - name: Set release tag id: set_release_tag - # ensure the tag is valid (matches code, is on main, etc) + # ensure the tag is valid (matches code, is on release branch, etc) run: | - RELEASE_TAG=${GITHUB_REF#refs/tags/} + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + RELEASE_TAG="${{ github.event.inputs.release_tag }}" + else + RELEASE_TAG=${GITHUB_REF#refs/tags/} + fi echo "Using tag: $RELEASE_TAG" ./scripts/validate-release-tag.sh "$RELEASE_TAG" echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV diff --git a/.github/workflows/publish-to-aws.yaml b/.github/workflows/publish-to-aws.yaml index 6e1739c..ead137d 100644 --- a/.github/workflows/publish-to-aws.yaml +++ b/.github/workflows/publish-to-aws.yaml @@ -6,6 +6,11 @@ on: # e.g. v1.0.0, v1.0.1, v1.0.0-rc1, etc. - "v[0-9]+.[0-9]+.[0-9]+*" workflow_dispatch: + inputs: + release_tag: + description: "Release tag to deploy (e.g. v1.2.0). Must match a tag that already exists." + required: true + type: string env: PACKAGE_NAME: layerlens @@ -24,7 +29,11 @@ jobs: id: set_release_tag # ensure the tag is valid (matches code, is on release branch, etc) run: | - RELEASE_TAG=${GITHUB_REF#refs/tags/} + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + RELEASE_TAG="${{ github.event.inputs.release_tag }}" + else + RELEASE_TAG=${GITHUB_REF#refs/tags/} + fi echo "Using tag: $RELEASE_TAG" chmod +x ./scripts/validate_release_tag.sh ./scripts/validate_release_tag.sh "$RELEASE_TAG" From b0ddafc2186129927275cf01916bf0000be3ebd8 Mon Sep 17 00:00:00 2001 From: Marin Peko <26385728+m-peko@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:17:25 +0100 Subject: [PATCH 2/3] Expand models, benchmarks results (#55) --- examples/public_benchmarks.py | 4 +++- examples/public_models.py | 9 +++++++ scripts/push-release-tag.sh | 4 ++-- src/layerlens/models/evaluation.py | 14 +++++------ src/layerlens/models/public.py | 5 ++++ .../public_benchmarks/public_benchmarks.py | 24 ++++++++++++------- .../resources/public_models/public_models.py | 24 ++++++++++++------- 7 files changed, 58 insertions(+), 26 deletions(-) diff --git a/examples/public_benchmarks.py b/examples/public_benchmarks.py index 396c0d9..491c51b 100644 --- a/examples/public_benchmarks.py +++ b/examples/public_benchmarks.py @@ -17,9 +17,11 @@ def main(): response = client.benchmarks.get(languages=["English"]) print(f"\nFound {response.total_count} English benchmarks") - # --- Filter by category + # --- Discover available filter values if response.categories: print(f"\nAvailable categories: {response.categories}") + if response.languages: + print(f"Available languages: {response.languages}") # --- Search by name response = client.benchmarks.get(query="mmlu") diff --git a/examples/public_models.py b/examples/public_models.py index 7d86550..be22040 100644 --- a/examples/public_models.py +++ b/examples/public_models.py @@ -44,6 +44,15 @@ def main(): response = client.models.get(include_deprecated=True) print(f"\nTotal models (including deprecated): {response.total_count}") + # --- Discover available filter values + response = client.models.get(page=1, page_size=1) + print(f"\nAvailable filter values:") + print(f" Categories: {response.categories}") + print(f" Companies: {response.companies}") + print(f" Regions: {response.regions}") + print(f" Licenses: {response.licenses}") + print(f" Sizes: {response.sizes}") + if __name__ == "__main__": main() diff --git a/scripts/push-release-tag.sh b/scripts/push-release-tag.sh index 552af3e..4404391 100755 --- a/scripts/push-release-tag.sh +++ b/scripts/push-release-tag.sh @@ -22,7 +22,7 @@ done git fetch --tags --prune -REPO_URL="https://github.com/LayerLens/atlas-python" +REPO_URL="https://github.com/LayerLens/stratix-python" TAG_PREFIX="v" COMMIT=$(git rev-parse --short HEAD) VERSION=$(bash "$ROOT_DIR/scripts/get_version.sh") @@ -68,5 +68,5 @@ git push origin "$TAG" echo "" echo "Tag ${TAG} has been created and pushed to origin. Check GitHub Actions for build progress:" -echo "https://github.com/LayerLens/atlas-python/actions/workflows/publish-sdk.yaml" +echo "https://github.com/LayerLens/stratix-python/actions/workflows/publish-sdk.yaml" echo "" \ No newline at end of file diff --git a/src/layerlens/models/evaluation.py b/src/layerlens/models/evaluation.py index 859d09f..7d16a3c 100644 --- a/src/layerlens/models/evaluation.py +++ b/src/layerlens/models/evaluation.py @@ -36,7 +36,7 @@ class EvaluationDataset(BaseModel): total_size: int = 0 training_size: int = 0 test_size: int = 0 - characteristics: List[str] = [] + characteristics: Optional[List[str]] = [] class EvaluationModelInfo(BaseModel): @@ -45,24 +45,24 @@ class EvaluationModelInfo(BaseModel): class PerformanceDetails(BaseModel): - strengths: List[str] = [] - challenges: List[str] = [] + strengths: Optional[List[str]] = [] + challenges: Optional[List[str]] = [] class ErrorAnalysis(BaseModel): - common_failure_modes: List[str] = [] + common_failure_modes: Optional[List[str]] = [] example: str = "" class AnalysisSummary(BaseModel): - key_takeaways: List[str] = [] + key_takeaways: Optional[List[str]] = [] class EvaluationSummary(BaseModel): name: str = "" goal: str = "" - metrics: List[EvaluationMetric] = [] - task_types: List[EvaluationTaskType] = [] + metrics: Optional[List[EvaluationMetric]] = [] + task_types: Optional[List[EvaluationTaskType]] = [] dataset: Optional[EvaluationDataset] = None model: Optional[EvaluationModelInfo] = None performance_details: Optional[PerformanceDetails] = None diff --git a/src/layerlens/models/public.py b/src/layerlens/models/public.py index 5905a09..00c9c14 100644 --- a/src/layerlens/models/public.py +++ b/src/layerlens/models/public.py @@ -31,6 +31,10 @@ class PublicModelDetail(BaseModel): class PublicModelsListResponse(BaseModel): models: List[PublicModelDetail] categories: List[str] = [] + companies: List[str] = [] + regions: List[str] = [] + licenses: List[str] = [] + sizes: List[str] = [] count: int total_count: int @@ -54,6 +58,7 @@ class PublicBenchmarkDetail(BaseModel): class PublicBenchmarksListResponse(BaseModel): datasets: List[PublicBenchmarkDetail] categories: List[str] = [] + languages: List[str] = [] count: int total_count: int diff --git a/src/layerlens/resources/public_benchmarks/public_benchmarks.py b/src/layerlens/resources/public_benchmarks/public_benchmarks.py index f73d75e..148de05 100644 --- a/src/layerlens/resources/public_benchmarks/public_benchmarks.py +++ b/src/layerlens/resources/public_benchmarks/public_benchmarks.py @@ -13,6 +13,10 @@ from ..._resource import SyncPublicAPIResource, AsyncPublicAPIResource from ..._constants import DEFAULT_TIMEOUT +DEFAULT_PAGE = 1 +DEFAULT_PAGE_SIZE = 100 +MAX_PAGE_SIZE = 500 + DEFAULT_PROMPTS_PAGE_SIZE = 100 MAX_PROMPTS_PAGE_SIZE = 500 @@ -47,14 +51,16 @@ def get( params["categories"] = ",".join(categories) if languages: params["languages"] = ",".join(languages) + effective_page_size = min(max(page_size, 1), MAX_PAGE_SIZE) if page_size is not None else DEFAULT_PAGE_SIZE + effective_page = page if page is not None else DEFAULT_PAGE + + params["page"] = str(effective_page) + params["pageSize"] = str(effective_page_size) + if sort_by: params["sortBy"] = sort_by if order: params["order"] = order - if page is not None: - params["page"] = str(page) - if page_size is not None: - params["pageSize"] = str(page_size) if include_deprecated is not None: params["include_deprecated"] = str(include_deprecated).lower() @@ -170,14 +176,16 @@ async def get( params["categories"] = ",".join(categories) if languages: params["languages"] = ",".join(languages) + effective_page_size = min(max(page_size, 1), MAX_PAGE_SIZE) if page_size is not None else DEFAULT_PAGE_SIZE + effective_page = page if page is not None else DEFAULT_PAGE + + params["page"] = str(effective_page) + params["pageSize"] = str(effective_page_size) + if sort_by: params["sortBy"] = sort_by if order: params["order"] = order - if page is not None: - params["page"] = str(page) - if page_size is not None: - params["pageSize"] = str(page_size) if include_deprecated is not None: params["include_deprecated"] = str(include_deprecated).lower() diff --git a/src/layerlens/resources/public_models/public_models.py b/src/layerlens/resources/public_models/public_models.py index 3b23b41..d092c3f 100644 --- a/src/layerlens/resources/public_models/public_models.py +++ b/src/layerlens/resources/public_models/public_models.py @@ -8,6 +8,10 @@ from ..._resource import SyncPublicAPIResource, AsyncPublicAPIResource from ..._constants import DEFAULT_TIMEOUT +DEFAULT_PAGE = 1 +DEFAULT_PAGE_SIZE = 100 +MAX_PAGE_SIZE = 500 + class PublicModelsResource(SyncPublicAPIResource): def get( @@ -50,14 +54,16 @@ def get( params["licenses"] = ",".join(licenses) if sizes: params["sizes"] = ",".join(sizes) + effective_page_size = min(max(page_size, 1), MAX_PAGE_SIZE) if page_size is not None else DEFAULT_PAGE_SIZE + effective_page = page if page is not None else DEFAULT_PAGE + + params["page"] = str(effective_page) + params["pageSize"] = str(effective_page_size) + if sort_by: params["sortBy"] = sort_by if order: params["order"] = order - if page is not None: - params["page"] = str(page) - if page_size is not None: - params["pageSize"] = str(page_size) if include_deprecated is not None: params["include_deprecated"] = str(include_deprecated).lower() @@ -115,14 +121,16 @@ async def get( params["licenses"] = ",".join(licenses) if sizes: params["sizes"] = ",".join(sizes) + effective_page_size = min(max(page_size, 1), MAX_PAGE_SIZE) if page_size is not None else DEFAULT_PAGE_SIZE + effective_page = page if page is not None else DEFAULT_PAGE + + params["page"] = str(effective_page) + params["pageSize"] = str(effective_page_size) + if sort_by: params["sortBy"] = sort_by if order: params["order"] = order - if page is not None: - params["page"] = str(page) - if page_size is not None: - params["pageSize"] = str(page_size) if include_deprecated is not None: params["include_deprecated"] = str(include_deprecated).lower() From 80d0b9b705cb3b36615650225feb5bce935e9064 Mon Sep 17 00:00:00 2001 From: m-peko Date: Tue, 3 Mar 2026 15:18:42 +0100 Subject: [PATCH 3/3] Bump version --- src/layerlens/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layerlens/_version.py b/src/layerlens/_version.py index 8fb65ee..df29efa 100644 --- a/src/layerlens/_version.py +++ b/src/layerlens/_version.py @@ -1,4 +1,4 @@ -__version__ = "1.2.0" +__version__ = "1.3.0" # Will be templated during the build __git_commit__ = "__GIT_COMMIT__"