A curated list of free LLM inference resources accessible via API. Build

  • MIT
  • 更新于 2026-05-15


What is Free LLM API Resources? #

Free LLM API Resources is a curated collection of free Large Language Model inference APIs — allowing developers to build AI-powered applications without paying for API access. Maintained by the community, it tracks which providers offer free tiers, what models are available, and how to access them.

GitHub: https://github.com/cheahjs/free-llm-api-resources Stars: 20,310+ Language: Python License: CC0-1.0 (Public Domain)

The Problem: AI API Costs### Current Pricing (2026)| Provider | Model | Input Cost | Output Cost | #

|———-

|——-

|————

|————-

| | OpenAI | GPT-4o | $5/M tokens | $15/M tokens | | Anthropic | Claude 3.5 | $3/M tokens | $15/M tokens | | Google | Gemini Pro | $3.50/M tokens | $10.50/M tokens | | Mistral | Large | $4/M tokens | $12/M tokens |Problem: Building AI apps costs $50-500/month in API fees.### The Solution: Free Tiers| Provider | Free Tier | Rate Limit | Models | |———-

|———–

|————

|——–

| | Groq | 100% free | 20 req/min | Llama 3, Mixtral | | Together AI | $5 credit | 60 req/min | Various OSS | | Fireworks AI | Trial | Varies | Multiple | | Ollama | Local | Unlimited | Self-hosted | | LM Studio | Local | Unlimited | Self-hosted |—

Free Tier: Completely free (rate limited) Speed: 800+ tokens/second Models:

  • Llama 3 70B
  • Llama 3 8B
  • Mixtral 8x7B
  • Gemma 7B``` pytho n import requests
Groq API (free tier) #

response = requests.post( “https://api.groq.com/openai/v1/chat/completions", headers={“Authorization”: “Bearer YOUR_FREE_API_KEY”}, json={ “model”: “llama3-70b-8192”, “messages”: [{“role”: “user”, “content”: “Hello!”}] } ) print(response.json()[“choices”][0][“message”][“content”])

**Free Tier**: $5 credit for new accounts
**Models**: 100+ open source models
**Features**: Fine-tuning, embeddings```
pytho
n
import openaiclient = openai.OpenAI(
    api_key="YOUR_TOGETHER_API_KEY",
    base_url="https://api.together.xyz/v1"
)response = client.chat.completions.create(
    model="meta-llama/Llama-3-70b-chat-hf",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)
print(response.choices[0].message.content)
```### 3. Ollama — Run```
pytho
n
import openai

client = openai.OpenAI(
    api_key="YOUR_TOGETHER_API_KEY",
    base_url="https://api.together.xyz/v1"
)

response = client.chat.completions.create(
    model="meta-llama/Llama-3-70b-chat-hf",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)
print(response.choices[0].message.content)
```/generate -d '{
  "model": "llama3",
  "prompt": "Why is the sky blue?"
}'
```### 4. LM Studio — GUI + API**Website**: https://lmstudio.ai
**Cost**: Free (local inference)
**Features**: GUI model browser, API server
**Best for**: Testing models, development```
pytho
n
# LM Studio local API
import openaiclient = openai.OpenAI(
    base_url="http://localhost: 1234/v1",
    api_key="not-needed"
)response = client.chat.completions.create(
    model="local-model",
    messages=[{"role": "user", "conten```
bas
h
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model
ollama pull llama3

# Run API server
ollama serve

# Use the API
curl http://localhost: 11434/api/generate -d '{
  "model": "llama3",
  "prompt": "Why is the sky blue?"
}'
```e
of Use | Best For |
|----------

|------

|-------

|---------

|-------------

|----------

|
| Groq | Free | ⚡⚡⚡ | ❌ | ⭐⭐⭐ | Production apps |
| Together | $5 credit | ⚡⚡ | ❌ | ⭐⭐⭐ | Experimentation |
| Ollama | Free | ⚡ | ✅ | ⭐⭐ | Privacy-focused |
| LM Studio | Free | ⚡ | ✅ | ⭐⭐⭐ | Development |
| Fireworks | Trial | ⚡⚡ | ❌ | ⭐⭐ | Fast inference |---

## Use Cases### 1. Development & Testing
- Prototype AI features
- Test prompts
- Build```
pytho
n
# LM Studio local API
import openai

client = openai.OpenAI(
    base_url="http://localhost: 1234/v1",
    api_key="not-needed"
)

response = client.chat.completions.create(
    model="local-model",
    messages=[{"role": "user", "content": "Hello!"}]
)
``` 4. Production (with care)
- Low-traffic applications
- Fallback providers
- Cost-sensitive projects
- Community tools---

## How to Choose### Decision Tree```
Need API access?
├── Yes → Need high speed?
│   ├── Yes → Groq (fastest)
│   └── No → Together AI (most models)
├── No → Need privacy?
│   ├── Yes → Ollama/LM Studio (local)
│   └── No → Consider paid options
```### Rate Limits Matter| Provider | Requests/min | Tokens/min | Notes |
|----------

|--------------

|------------

|-------

|
| Groq | 20 | 6,000 | Generous for dev |
| Together | 60 | 12,000 | Good for testing |
| Ollama | Unlimited | Hardware limit | Your hardware = limit |---

## Community & Updates### How to ContributeThe repository is community-maintained:
1. **Star** the repo to support
2. **Submit PRs** for new providers
3. **Report** broken links
4. **Share** your experience### Stay Updated- **Watch** the GitHub repo
- **Check** monthly for new providers
- **Join** discussions for tips
- **Follow** @cheahjs on GitHub---

## Related Articles- Free Claude Code: Open Source AI Coding — More free AI tools
- [TabPFN: Foundation Model for Tabular Data](/resources/ai-tools/tabpfn-foundation-model-tabular-data/) — AI for data science
- [OpenClaw 42 Use Cases](/resources/llm-frameworks/awesome-openclaw-usecases-ai-agent-daily-life/) — AI agent applications---*```
Need API access?
├── Yes → Need high speed?
│   ├── Yes → Groq (fastest)
│   └── No → Together AI (most models)
├── No → Need privacy?
│   ├── Yes → Ollama/LM Studio (local)
│   └── No → Consider paid options
```n
g
or deploying open-source AI tools, we recommend:- **DigitalOcean
** — $200 free credit for new users, 14+ global regions, one-click GPU/CPU droplets ideal for AI workloads.
- **Shiyunapi Claude API
** — Anthropic Claude / OpenAI / DeepSeek API proxy. Single key access to multiple top models at ~30% of official pricing; particularly useful when comparing models or when direct API access is rate-limited in your region.*Affiliate link — supports dibi8.com at no cost to you.*<!--auto-references-->
## References & Sources- [free-llm-api-resources](https://github.com/cheahjs/free-llm-api-resources)
- [Ollama](https://github.com/ollama/ollama)
- [Groq](https://groq.com)
- [Together AI](https://www.together.ai)
- [LM Studio](https://lmstudio.ai)
- [Fireworks AI](https://fireworks.ai)

💬 留言讨论