Run this model with HF Jobs

Run brendanboyle/Inkling-2-Mini-Codex-MLX on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/brendanboyle/Inkling-2-Mini-Codex-MLX. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/brendanboyle/Inkling-2-Mini-Codex-MLX on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/brendanboyle/Inkling-2-Mini-Codex-MLX. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/brendanboyle/Inkling-2-Mini-Codex-MLX. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
File size: 2,792 Bytes
dbe026e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""Verify a local Inkling server returns a structured tool call."""

import argparse
import json
from time import monotonic
from urllib.request import Request, urlopen

FUNCTION = {
    "name": "record_status",
    "description": "Record a status value.",
    "parameters": {
        "type": "object",
        "properties": {"status": {"type": "string"}},
        "required": ["status"],
        "additionalProperties": False,
    },
}
EXPECTED = {"status": "inkling adapter ready"}
PROMPT = 'Call record_status once, with status exactly "inkling adapter ready".'


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--port", type=int, required=True)
    parser.add_argument("--model", required=True)
    parser.add_argument("--effort", choices=("none", "high"), required=True)
    parser.add_argument("--protocol", choices=("chat", "responses"), default="chat")
    args = parser.parse_args()
    common = {"model": args.model, "temperature": 0, "stream": False}
    if args.protocol == "chat":
        endpoint = "chat/completions"
        payload = {
            **common,
            "messages": [{"role": "user", "content": PROMPT}],
            "tools": [{"type": "function", "function": FUNCTION}],
            "max_tokens": 2048,
            "chat_template_kwargs": {"reasoning_effort": args.effort},
        }
    else:
        endpoint = "responses"
        payload = {
            **common,
            "input": PROMPT,
            "tools": [{"type": "function", **FUNCTION}],
            "max_output_tokens": 2048,
            "reasoning": {"effort": args.effort},
        }
    request = Request(
        f"http://127.0.0.1:{args.port}/v1/{endpoint}",
        data=json.dumps(payload).encode(),
        headers={"Content-Type": "application/json"},
    )
    start = monotonic()
    with urlopen(request, timeout=90) as response:
        result = json.load(response)
    if args.protocol == "chat":
        calls = [
            item["function"]
            for item in result["choices"][0]["message"].get("tool_calls", [])
        ]
    else:
        calls = [item for item in result["output"] if item["type"] == "function_call"]
    actual = [(call["name"], json.loads(call["arguments"])) for call in calls]
    if actual != [(FUNCTION["name"], EXPECTED)]:
        raise ValueError(f"Unexpected tool calls: {actual!r}")
    print(json.dumps({
        "protocol": args.protocol,
        "reasoning_effort": args.effort,
        "structured_tool_call_passed": True,
        "generated_tokens": result.get("usage", {}).get(
            "completion_tokens" if args.protocol == "chat" else "output_tokens"
        ),
        "wall_seconds": round(monotonic() - start, 3),
    }, indent=2))


if __name__ == "__main__":
    main()