Skip to content

Conversation

@ackizilkale
Copy link
Contributor

Improve model runner endpoint logging clarity

Summary

Replace confusing "POST /v2/.../outputs" endpoint strings in model runner logging with clearer operation names.

Problem

The current logging uses misleading HTTP method patterns like "POST /v2/.../outputs" which confuses readers into thinking these are actual HTTP requests when they're internal model runner operations.

Changes

  • "POST /v2/.../outputs""model_predict"
  • "POST /v2/.../outputs/generate""model_generate"
  • "POST /v2/.../outputs/stream""model_stream"

Benefits

  • Clearer intent: Log messages now clearly indicate what operation is being performed
  • Less confusion: No more misleading HTTP method references
  • Consistent formatting: Removes inconsistent spacing in endpoint strings
  • Better readability: Logs now show clear operation names instead of confusing pseudo-HTTP patterns

Before/After

Before:

POST /v2/.../outputs | SUCCESS | 245.67ms | req_id=abc123 POST /v2/.../outputs/generate | SUCCESS | 1234.56ms | req_id=def456 POST /v2/.../outputs/stream | ERROR | 567.89ms | req_id=ghi789 

After:

model_predict | SUCCESS | 245.67ms | req_id=abc123 model_generate | SUCCESS | 1234.56ms | req_id=def456 model_stream | ERROR | 567.89ms | req_id=ghi789 

This makes it immediately clear that these are internal model runner operations, not HTTP requests.

Files Changed

  • clarifai/runners/models/model_runner.py - Updated logging endpoint strings in three methods:
    • runner_item_predict() (line ~136)
    • runner_item_generate() (line ~207)
    • runner_item_stream() (line ~263)
@ackizilkale ackizilkale requested a review from luv-bansal October 8, 2025 19:41
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Code Coverage

Package Line Rate Health
clarifai 43%
clarifai.cli 44%
clarifai.cli.templates 36%
clarifai.client 67%
clarifai.client.auth 67%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.modules 0%
clarifai.rag 72%
clarifai.runners 52%
clarifai.runners.models 58%
clarifai.runners.pipeline_steps 41%
clarifai.runners.pipelines 70%
clarifai.runners.utils 63%
clarifai.runners.utils.data_types 72%
clarifai.schema 100%
clarifai.urls 60%
clarifai.utils 59%
clarifai.utils.evaluation 67%
clarifai.workflows 95%
Summary 61% (8075 / 13134)

Minimum allowed line rate is 50%

@ackizilkale ackizilkale requested a review from a team October 16, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants