openmodelmap 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openmodelmap
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: OpenModelMap Python SDK — query 2,484 AI models with one line of code
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://openmodelmap.com/api
|
|
7
|
+
Project-URL: Documentation, https://openmodelmap.com/api
|
|
8
|
+
Project-URL: Repository, https://github.com/duola15/open-source-model-nav
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# OpenModelMap Python SDK
|
|
23
|
+
|
|
24
|
+
Zero-config API client for querying 2,484 open-source AI models.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from openmodelmap import OpenModelMap
|
|
28
|
+
|
|
29
|
+
omm = OpenModelMap() # api_key optional for free tier
|
|
30
|
+
|
|
31
|
+
# Search models
|
|
32
|
+
models = omm.models(gpu="rtx4070", task="coding", limit=5)
|
|
33
|
+
|
|
34
|
+
# Get GPU recommendations
|
|
35
|
+
gpu_models = omm.gpu("rtx4070", task="coding")
|
|
36
|
+
|
|
37
|
+
# Get single model
|
|
38
|
+
model = omm.model("deepseek-ai/DeepSeek-V3")
|
|
39
|
+
|
|
40
|
+
# Get rankings
|
|
41
|
+
rankings = omm.rankings("frontier-models")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install openmodelmap
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Pricing
|
|
51
|
+
|
|
52
|
+
| Tier | Rate Limit | Price |
|
|
53
|
+
|------|-----------|-------|
|
|
54
|
+
| Free | 500 req/day | $0 |
|
|
55
|
+
| Pro | 10,000 req/day | $29/month |
|
|
56
|
+
| Ultra | 50,000 req/day | $79/month |
|
|
57
|
+
|
|
58
|
+
## Docs
|
|
59
|
+
|
|
60
|
+
https://openmodelmap.com/api
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
openmodelmap.py,sha256=9x-0UqXf9-Zn82U20gHNWuhgV_7RA1GJ0F9ArBDvrUU,2753
|
|
2
|
+
openmodelmap-1.0.0.dist-info/METADATA,sha256=arc2ecieDwpy8OuETw43_4TgNWhPVVuMEsk2MVbh3I0,1707
|
|
3
|
+
openmodelmap-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
4
|
+
openmodelmap-1.0.0.dist-info/top_level.txt,sha256=B-CWTAcH-ODJJA7OoRFJ3gGeN2LlEnXReW0QLPuhYyM,13
|
|
5
|
+
openmodelmap-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
openmodelmap
|
openmodelmap.py
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""
|
|
2
|
+
OpenModelMap Python SDK — zero-config API client.
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
from openmodelmap import OpenModelMap
|
|
6
|
+
omm = OpenModelMap(api_key="xxx") # api_key optional for free tier
|
|
7
|
+
models = omm.models(gpu="rtx4070", task="coding")
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from urllib.parse import urlencode
|
|
11
|
+
from urllib.request import Request, urlopen
|
|
12
|
+
from urllib.error import HTTPError
|
|
13
|
+
import json
|
|
14
|
+
|
|
15
|
+
API_BASE = "https://openmodelmap.com/api/v1"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class OpenModelMap:
|
|
19
|
+
def __init__(self, api_key: str = "", base_url: str = API_BASE):
|
|
20
|
+
self.api_key = api_key
|
|
21
|
+
self.base_url = base_url
|
|
22
|
+
|
|
23
|
+
def _get(self, path: str) -> dict:
|
|
24
|
+
headers = {"Accept": "application/json", "User-Agent": "openmodelmap-sdk/1.0"}
|
|
25
|
+
if self.api_key:
|
|
26
|
+
headers["x-api-key"] = self.api_key
|
|
27
|
+
|
|
28
|
+
req = Request(self.base_url + path, headers=headers)
|
|
29
|
+
try:
|
|
30
|
+
with urlopen(req, timeout=30) as res:
|
|
31
|
+
return json.loads(res.read())
|
|
32
|
+
except HTTPError as e:
|
|
33
|
+
body = json.loads(e.read())
|
|
34
|
+
raise Exception(body.get("message", f"HTTP {e.code}"))
|
|
35
|
+
|
|
36
|
+
def models(
|
|
37
|
+
self,
|
|
38
|
+
search: str = None,
|
|
39
|
+
task: str = None,
|
|
40
|
+
gpu: str = None,
|
|
41
|
+
org: str = None,
|
|
42
|
+
license: str = None,
|
|
43
|
+
min_params: float = None,
|
|
44
|
+
max_params: float = None,
|
|
45
|
+
sort: str = None,
|
|
46
|
+
order: str = None,
|
|
47
|
+
page: int = None,
|
|
48
|
+
limit: int = None,
|
|
49
|
+
fields: str = None,
|
|
50
|
+
) -> dict:
|
|
51
|
+
"""Search and filter models. Returns {ok, total, page, limit, data}."""
|
|
52
|
+
params = {}
|
|
53
|
+
for k, v in {
|
|
54
|
+
"search": search, "task": task, "gpu": gpu, "org": org,
|
|
55
|
+
"license": license, "min_params": min_params, "max_params": max_params,
|
|
56
|
+
"sort": sort, "order": order, "page": page, "limit": limit, "fields": fields,
|
|
57
|
+
}.items():
|
|
58
|
+
if v is not None:
|
|
59
|
+
params[k] = str(v)
|
|
60
|
+
qs = "?" + urlencode(params) if params else ""
|
|
61
|
+
return self._get(f"/models{qs}")
|
|
62
|
+
|
|
63
|
+
def model(self, id: str) -> dict:
|
|
64
|
+
"""Get a single model by ID. Returns {ok, data}."""
|
|
65
|
+
return self._get(f"/models/{id}")
|
|
66
|
+
|
|
67
|
+
def gpu(self, name: str, task: str = None, limit: int = None) -> dict:
|
|
68
|
+
"""Get GPU recommendations. Returns {ok, gpu, task, data}."""
|
|
69
|
+
params = {}
|
|
70
|
+
if task: params["task"] = task
|
|
71
|
+
if limit: params["limit"] = str(limit)
|
|
72
|
+
qs = "?" + urlencode(params) if params else ""
|
|
73
|
+
return self._get(f"/gpu/{name}{qs}")
|
|
74
|
+
|
|
75
|
+
def rankings(self, slug: str = None) -> dict:
|
|
76
|
+
"""Get model rankings. Returns {ok, data}."""
|
|
77
|
+
params = {}
|
|
78
|
+
if slug: params["slug"] = slug
|
|
79
|
+
qs = "?" + urlencode(params) if params else ""
|
|
80
|
+
return self._get(f"/rankings{qs}")
|