Qwen2.5-7B-Instruct — Free API

⭐ Score: 40
hugging-face/qwen2-5-7b-instruct
🛠️ Function Calling JSON Mode chat

What is Qwen2.5-7B-Instruct?

Qwen2.5 7B Instruct is Alibaba's efficient 7B model, available free on Hugging Face's Serverless Inference API. With 131K context and strong multilingual (Chinese-English) performance, it is a solid lightweight option for chat, translation, and text processing. The 4K per-request output cap on HF's free tier limits it to short-form responses. Uses Hugging Face's native API format; approximately 1,000 requests per day. Registration required.

Model ID
qwen2-5-7b-instruct
Base URL
https://router.huggingface.co/v1

Qwen2.5-7B-Instruct API Code Example

Paste your API key and run. See the config generator for Claude Code, Cursor, and more tools.

from openai import OpenAI

client = OpenAI(
    base_url="https://router.huggingface.co/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="qwen2-5-7b-instruct",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://router.huggingface.co/v1",
  apiKey: "YOUR_API_KEY",
});

const completion = await openai.chat.completions.create({
  model: "qwen2-5-7b-instruct",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(completion.choices[0].message.content);
curl https://router.huggingface.co/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "qwen2-5-7b-instruct",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Other Free Models from Hugging Face

More About Hugging Face

How to get an API key, rate limits, platform limitations, and tool configuration — everything you need to set up Hugging Face as a free LLM API backend.

View Hugging Face full guide →