# AI Model Intelligence (`hakashi_katake/ai-model-intelligence`) Actor

Discover and normalize AI model metadata from Hugging Face, GitHub, Ollama, and OpenRouter in one structured dataset. Track models, providers, capabilities, licenses, popularity, and availability.

- **URL**: https://apify.com/hakashi\_katake/ai-model-intelligence.md
- **Developed by:** [Hakashi Katake](https://apify.com/hakashi_katake) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 model results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Model Intelligence

An Apify Actor that collects public AI/ML model metadata from verified official APIs and emits one normalized record per model.

### What it does

The Actor supports two modes:

- Specific lookup with `models`, such as `meta-llama/Llama-3.1-8B-Instruct` or `owner/repository`.
- Discovery with `query`, or a source-specific default discovery when both `models` and `query` are empty.

It queries only documented APIs, merges equivalent records deterministically, preserves source attribution, and continues when one source fails.

### Supported sources

| Source | Official API used | Authentication | Notes |
| --- | --- | --- | --- |
| Hugging Face | `GET https://huggingface.co/api/models` and model detail | Optional `HF_TOKEN` | Public metadata and current aggregate downloads/likes |
| GitHub | `GET /search/repositories` and `GET /repos/{owner}/{repo}` | Optional `GITHUB_TOKEN` | Repository relevance is a best-effort model signal |
| Ollama | `GET {OLLAMA_BASE_URL}/tags` | Local server: none; cloud: `OLLAMA_API_KEY` | Reports models available to one configured Ollama server; no HTML library scraping |
| OpenRouter | `GET https://openrouter.ai/api/v1/models` | Optional `OPENROUTER_API_KEY` | Catalog metadata, context length, modalities, and pricing |

The complete verification record, including rate limits, restrictions, response fields, and source URLs, is in [`docs/API_RESEARCH.md`](docs/API_RESEARCH.md).

### Input

```json
{
  "query": "qwen",
  "models": [],
  "sources": ["huggingface", "github", "ollama", "openrouter"],
  "maxItems": 100,
  "includeMomentum": true,
  "snapshotStoreName": "ai-model-intelligence-snapshots",
  "timeoutMs": 15000,
  "maxRetries": 2
}
```

`models` takes precedence over `query` for source-specific lookup. `sources` defaults to all four sources. Use a persistent named `snapshotStoreName` for momentum across scheduled runs; without it, snapshots are run-local.

### Output

The default Dataset contains one record per normalized model:

```json
{
  "modelId": "qwen/qwen2.5-7b-instruct",
  "name": "Qwen2.5-7B-Instruct",
  "provider": "qwen",
  "description": null,
  "architecture": null,
  "parameterCount": null,
  "contextLength": 32768,
  "modalities": ["text"],
  "license": null,
  "releaseDate": "2024-09-18T00:00:00.000Z",
  "lastUpdated": null,
  "huggingFace": {
    "url": "https://huggingface.co/Qwen/Qwen2.5-7B-Instruct",
    "downloads": 0,
    "likes": 0,
    "tags": [],
    "library": "transformers"
  },
  "github": {
    "url": null,
    "stars": null,
    "forks": null,
    "openIssues": null,
    "contributors": null
  },
  "ollama": {
    "url": null,
    "available": null,
    "pulls": null
  },
  "openRouter": {
    "url": null,
    "available": true,
    "inputPrice": "0.0000004",
    "outputPrice": "0.0000004",
    "contextLength": 32768
  },
  "providers": ["qwen"],
  "momentum": {
    "starsGrowth": null,
    "forkGrowth": null,
    "downloadGrowth": null,
    "momentumScore": null
  },
  "sources": [],
  "errors": [],
  "observedAt": "2026-09-27T00:00:00.000Z"
}
```

The example values are illustrative; unavailable values are emitted as `null`, not inferred.

### Momentum and snapshots

Each run can save the current GitHub stars/forks and Hugging Face downloads in the `MODEL_SNAPSHOTS` Key-Value Store record. On later runs, the Actor calculates percentage growth and a bounded average score from values that existed in both snapshots. No historical data is claimed when the source does not provide it.

For scheduled runs, create or reuse a named Apify Key-Value Store and pass its name as `snapshotStoreName`.

### Error handling

Every source has a bounded timeout and retry policy. `408`, `425`, `429`, and common `5xx` responses are retried with backoff; `Retry-After` is honored when present. Source failures are recorded in the run `OUTPUT` summary and, when relevant, on model records under `errors`. A failed source does not discard successful results from other sources.

An unavailable local Ollama server is expected in a hosted run unless `OLLAMA_BASE_URL` points at a reachable server; this is reported as an Ollama error.

### Credentials and environment

Set only the credentials needed for the sources you enable:

```bash
export HF_TOKEN="..."
export GITHUB_TOKEN="..."
export OLLAMA_BASE_URL="https://ollama.com/api"
export OLLAMA_API_KEY="..."
export OPENROUTER_API_KEY="..."
```

Credentials are read from environment variables and are not included in Dataset records.

### Local development

Requirements: Node.js 20+ and npm.

```bash
npm install
npm run typecheck
npm test
npm run build
```

To run the Actor locally with the Apify CLI, place input in `storage/key_value_stores/default/INPUT.json` and run `apify run`. Local Dataset and Key-Value Store data remains under `storage/`.

The verified live API smoke tests are opt-in so ordinary unit tests do not consume external quotas:

```bash
RUN_INTEGRATION=1 npm run test:integration
```

### Limitations and pricing considerations

- GitHub search is not a model registry; search results are relevance-based repository candidates.
- Ollama `/api/tags` is server-local/cloud-account inventory, not a global public model catalog. Pull counts are unavailable from the documented response.
- Hugging Face download and like values are current aggregates. Growth needs at least two runs with a persistent snapshot store.
- Provider pricing is populated only from OpenRouter’s catalog response. The Actor does not make inference requests and does not incur token charges.
- Public API quotas and plan pricing are controlled by each provider and can change. Consult the official links in `docs/API_RESEARCH.md` before large scheduled crawls.

# Actor input Schema

## `query` (type: `string`):

Optional search text. Use this for discovery when models is empty.

## `models` (type: `array`):

Specific model IDs, repository IDs, or model names to look up.

## `sources` (type: `array`):

Official APIs to query. Omit to query all four sources.

## `maxItems` (type: `integer`):

Maximum number of normalized models emitted by the Actor.

## `includeMomentum` (type: `boolean`):

Compare current observations with a prior snapshot when a snapshot store is available.

## `snapshotStoreName` (type: `string`):

Optional named Apify Key-Value Store. Use the same name across scheduled runs to calculate growth.

## `timeoutMs` (type: `integer`):

Maximum time allowed for one external API request.

## `maxRetries` (type: `integer`):

Maximum bounded retries for transient HTTP failures.

## Actor input object example

```json
{
  "query": "",
  "models": [],
  "sources": [
    "huggingface",
    "github",
    "ollama",
    "openrouter"
  ],
  "maxItems": 100,
  "includeMomentum": true,
  "snapshotStoreName": "",
  "timeoutMs": 15000,
  "maxRetries": 2
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hakashi_katake/ai-model-intelligence").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("hakashi_katake/ai-model-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call hakashi_katake/ai-model-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hakashi_katake/ai-model-intelligence"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8FLgHHgdgdmBvhgZb/builds/DUlXDP2w2Myf8ReLw/openapi.json
