K2-Horizon-7B — Read Me
IFM logo

K2-Horizon-7B

A free, OpenAI-compatible endpoint for IFM's fully open 7B reasoning model: 512K native context, tool calling, and 70.6 on SWE-bench Verified. No API key, no signup.

7B DENSE CORE · 9B TOTAL 512K NATIVE CONTEXT APACHE 2.0 · FULLY OPEN TOOL CALLING 1× H200 · vLLM

The Endpoint

A free, public Hugging Face Inference Endpoint for IFM/K2-Horizon-7B — an OpenAI-compatible Chat Completions API. No Hugging Face token required: point any OpenAI SDK, curl, or agent framework at the base URL and go.

Published September 1 by IFM (Institute of Foundation Models), K2-Horizon-7B is the mid-size dense member of the K2-Horizon family. Radically open: weights, training data, and dozens of intermediate checkpoints from every stage (pretraining, four context-extension stages, RL, SFT) are published as branches and tags of the repo. IFM reports SWE-bench Verified 70.6, HMMT Feb 2026 73.3, BrowseComp 59.0, and Terminal-Bench 2.1 39.1. Served here in BF16 on a single H200.

!

This is a Community Endpoint

Shared, free, and rate-limited to be fair to everyone: per IP, about 10 requests in a burst refilling to roughly 15 requests/minute, and at most 4 requests in flight at once. Parallel agent tool calls are fine — hammering it from a script is not, and sources that keep slamming the limits get paused for 10 minutes. Over a limit you'll get a 429 with a friendly note and a Retry-After header. Requests that don't set max_tokens get 32,768 here. It will be retired after the launch buzz cools down.

Terminal — Quickstart

Getting Started

One base URL, standard OpenAI API, model id IFM/K2-Horizon-7B. Any string works as the API key.

endpoint URL
https://p95xmvkl9cy4a03y.us-east-2.aws.endpoints.huggingface.cloud/v1
Terminal — curl
curl https://p95xmvkl9cy4a03y.us-east-2.aws.endpoints.huggingface.cloud/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "IFM/K2-Horizon-7B",
    "messages": [{"role": "user", "content": "Explain grouped-query attention in one paragraph."}]
  }'
quickstart.py
from openai import OpenAI

client = OpenAI(
    base_url="https://p95xmvkl9cy4a03y.us-east-2.aws.endpoints.huggingface.cloud/v1",
    api_key="none",  # no key required
)

r = client.chat.completions.create(
    model="IFM/K2-Horizon-7B",
    messages=[{"role": "user", "content": "Three fun facts about K2, the mountain?"}],
)
msg = r.choices[0].message
print(msg.reasoning)  # the thinking trace
print(msg.content)    # the final answer

Streaming (reasoning arrives as delta.reasoning), tool calling, response_format JSON schemas, and the /v1/responses API all work as in the OpenAI API. The model card's sampling (temperature=1.0, top_p=0.95) is applied by default.

Chat With It

Prefer a UI?

A full chat-ui front end runs on this same endpoint: streamed thinking, markdown, and code blocks. Free, no account needed.

Thinking & Tools

Always Thinking, At Full Effort

K2-Horizon-7B always reasons before it answers; there is no off switch. The trace comes back separately in message.reasoning and message.content stays clean. On everyday prompts it thinks for a few hundred to ~2,000 tokens, which at this endpoint's speed is 2 to 10 seconds.

The chat template has high, medium, and low tiers, but in this release the model closes medium and low with the high-tier tag, which breaks the split between thinking and answer. So every request here runs at high (IFM's own recommendation, and what all its reported results use): reasoning_effort is accepted and ignored.

Tool Calling

Send standard OpenAI tools; you get back parsed tool_calls, including several in one turn. The model's native XML call format is used under the hood (its JSON mode was unreliable in testing), and you don't need to send reasoning back in the history.

tools.py
tools = [{"type": "function", "function": {
    "name": "get_weather",
    "description": "Current weather for a city.",
    "parameters": {"type": "object",
                   "properties": {"city": {"type": "string"}},
                   "required": ["city"]}}}]

r = client.chat.completions.create(
    model="IFM/K2-Horizon-7B",
    messages=[{"role": "user", "content": "Is it warmer in Oslo or Lima?"}],
    tools=tools,
)
for call in r.choices[0].message.tool_calls:
    print(call.function.name, call.function.arguments)

IFM recommends leaving room for at least 32,768 output tokens: a response cut off mid-thought is a failed response, not a shorter one.

Terminal — pi (pi-mono)

Wiring It Into pi

pi reads custom model providers from ~/.pi/agent/models.json. Add a provider entry pointing at this endpoint's OpenAI-compatible base URL, then select it from the CLI.

~/.pi/agent/models.json
{
  "providers": {
    "hf-k2-horizon": {
      "name": "K2-Horizon-7B (HF public)",
      "baseUrl": "https://p95xmvkl9cy4a03y.us-east-2.aws.endpoints.huggingface.cloud/v1",
      "api": "openai-completions",
      "apiKey": "not-needed",
      "compat": {
        "supportsReasoningEffort": true,
        "maxTokensField": "max_tokens"
      },
      "models": [{
        "id": "IFM/K2-Horizon-7B",
        "name": "K2-Horizon-7B",
        "reasoning": true,
        "thinkingLevelMap": {
          "off": "high",
          "minimal": "high",
          "low": "high",
          "medium": "high",
          "high": "high",
          "xhigh": "high"
        },
        "input": ["text"],
        "contextWindow": 262144,
        "maxTokens": 32768,
        "cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0}
      }]
    }
  }
}

Then run it — pi picks up models.json on launch:

Terminal — zsh
# interactive
pi --provider hf-k2-horizon --model IFM/K2-Horizon-7B

# one-shot, non-interactive
pi -p --no-session --provider hf-k2-horizon \
  --model IFM/K2-Horizon-7B \
  "Summarize this repo's README."

# add it to your Ctrl+P model cycle alongside others
pi --models "hf-k2-horizon/*,sonnet,haiku"

Every pi thinking level maps to high, the only tier this endpoint serves. Same shape works for any OpenAI-compatible server — swap baseUrl for a local vllm serve instance and keep the rest.

Get Info — Specs

This Deployment

ItemValue
ModelIFM/K2-Horizon-7B · Apache 2.0 · BF16, main at ff325e2
Parameters9.0B total: a 6.95B transformer ("7B core") plus 2.05B of untied 250K-vocabulary embeddings
ArchitectureDense decoder · 36 layers · grouped-query attention (32 query / 8 KV heads) · SwiGLU · RMSNorm in 4 groups · RoPE θ=10M · no sliding window
Training22.9T pretraining tokens at 8K · four context-extension stages to 512K (1.9T) · RL on five expert branches, merged · two SFT phases (249B)
Context window524,288 tokens native · 262,144 served here, with a ~600 KB request cap
Hardware1× NVIDIA H200 (141 GB) · 772K-token KV cache · autoscales to 2 replicas
EnginevLLM nightly (cd10ed6) with native K2-Horizon model, reasoning and tool parsers · no speculative decoding
Measured~0.22 s first token · ~176 tok/s per stream idle · ~164 tok/s each at 16 concurrent, ~150 at 32 (4.8k tok/s aggregate) · 33K-token needle retrieval verified
Rate limit~15 requests/min per IP (burst 10), max 4 in flight, ~600 KB request cap, default max_tokens 32,768 · 429/413 + Retry-After when exceeded

Measured numbers are from this deployment's own verification battery, not marketing. Benchmark scores above are IFM's, as reported on the model card.

About This Hardware

Powered by Hugging Face Inference Endpoints

This whole thing — an H200, a nightly vLLM build, rate limiting — is one deploy form on Inference Endpoints: dedicated, production-grade deployments of any model on the Hub.

Pick a model, pick your hardware (CPU to multi-GPU H200), and get an OpenAI-compatible URL with autoscaling, scale-to-zero, and per-minute billing. No shared queues, no rate limits from strangers — your model, your GPUs.

7 windows · k2-horizon-7b · free & rate-limited