Spaces:
Running
Running
Upload 2 files
Browse files- README.md +2 -1
- index.html +11 -56
README.md
CHANGED
|
@@ -6,7 +6,7 @@ colorTo: pink
|
|
| 6 |
sdk: static
|
| 7 |
pinned: true
|
| 8 |
license: mit
|
| 9 |
-
short_description: Modelflare gateway
|
| 10 |
---
|
| 11 |
|
| 12 |
# Start with Modelflare
|
|
@@ -18,6 +18,7 @@ Hugging Face landing for [Modelflare](https://modelflare.dev/) — OpenAI-compat
|
|
| 18 |
- SDK guide: https://huggingface.co/spaces/Modelflare/openai-sdk
|
| 19 |
- Coding agents: https://huggingface.co/spaces/Modelflare/coding-agents
|
| 20 |
- API recipes: https://huggingface.co/spaces/Modelflare/api-recipes
|
|
|
|
| 21 |
- Dataset: https://huggingface.co/datasets/Modelflare/api-examples
|
| 22 |
- Collection: https://huggingface.co/collections/Modelflare/modelflare-getting-started
|
| 23 |
- Discussion: https://huggingface.co/spaces/Modelflare/start/discussions/1
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: true
|
| 8 |
license: mit
|
| 9 |
+
short_description: "Modelflare gateway: console, docs, SDK guide, blog"
|
| 10 |
---
|
| 11 |
|
| 12 |
# Start with Modelflare
|
|
|
|
| 18 |
- SDK guide: https://huggingface.co/spaces/Modelflare/openai-sdk
|
| 19 |
- Coding agents: https://huggingface.co/spaces/Modelflare/coding-agents
|
| 20 |
- API recipes: https://huggingface.co/spaces/Modelflare/api-recipes
|
| 21 |
+
- Blog: https://huggingface.co/spaces/Modelflare/blog
|
| 22 |
- Dataset: https://huggingface.co/datasets/Modelflare/api-examples
|
| 23 |
- Collection: https://huggingface.co/collections/Modelflare/modelflare-getting-started
|
| 24 |
- Discussion: https://huggingface.co/spaces/Modelflare/start/discussions/1
|
index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -46,48 +46,8 @@
|
|
| 46 |
</head>
|
| 47 |
<body>
|
| 48 |
<div class="wrap">
|
| 49 |
-
<div class="lang">
|
| 50 |
-
<button type="button" class="on" data-lang="zh">中文</button>
|
| 51 |
-
<button type="button" data-lang="en">English</button>
|
| 52 |
-
</div>
|
| 53 |
|
| 54 |
-
<section id="
|
| 55 |
-
<div class="badge">Hugging Face × Modelflare</div>
|
| 56 |
-
<h1>稳定、更省的 AI API 网关</h1>
|
| 57 |
-
<p class="lead">文本 / 图片 / 视频同一把钥匙。OpenAI 兼容 —— 把 SDK 的 <code>base_url</code> 指到 <code>https://modelflare.dev/v1</code>,带分组故障转移与按请求成本记录。</p>
|
| 58 |
-
<div class="cta">
|
| 59 |
-
<a class="btn primary" href="https://modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=start" target="_blank" rel="noopener">打开控制台 →</a>
|
| 60 |
-
<a class="btn ghost" href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=start" target="_blank" rel="noopener">阅读文档</a>
|
| 61 |
-
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_blank" rel="noopener">SDK 一行接入</a>
|
| 62 |
-
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_blank" rel="noopener">Coding Agents</a>
|
| 63 |
-
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_blank" rel="noopener">API Recipes</a>
|
| 64 |
-
<a class="btn ghost" href="https://huggingface.co/collections/Modelflare/modelflare-getting-started" target="_blank" rel="noopener">Getting Started 合集</a>
|
| 65 |
-
<a class="btn ghost" href="https://huggingface.co/datasets/Modelflare/api-examples" target="_blank" rel="noopener">示例 Dataset</a>
|
| 66 |
-
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/start/discussions/1" target="_blank" rel="noopener">讨论 #1</a>
|
| 67 |
-
</div>
|
| 68 |
-
<div class="grid">
|
| 69 |
-
<div class="card"><h3>一把钥匙</h3><p>Chat、Responses、Anthropic Messages、图片与视频共用鉴权。</p></div>
|
| 70 |
-
<div class="card"><h3>分组故障转移</h3><p>主路由不可用时按序回退,请求不白挂。</p></div>
|
| 71 |
-
<div class="card"><h3>用量与成本</h3><p>按请求记录 token / 图片 / 视频花费;Smart keys 与缓存命中保障。</p></div>
|
| 72 |
-
</div>
|
| 73 |
-
<h2>快速开始</h2>
|
| 74 |
-
<pre><button class="copy" type="button">复制</button><code>from openai import OpenAI
|
| 75 |
-
|
| 76 |
-
client = OpenAI(
|
| 77 |
-
api_key="YOUR_MODELFLARE_KEY",
|
| 78 |
-
base_url="https://modelflare.dev/v1",
|
| 79 |
-
)
|
| 80 |
-
|
| 81 |
-
r = client.chat.completions.create(
|
| 82 |
-
model="grok-4.7",
|
| 83 |
-
messages=[{"role": "user", "content": "Hello from Hugging Face"}],
|
| 84 |
-
)
|
| 85 |
-
print(r.choices[0].message.content)</code></pre>
|
| 86 |
-
<div class="note"><strong>从 Hub 来?</strong>先领 key,再看 <a href="https://huggingface.co/spaces/Modelflare/openai-sdk">中英 SDK 教程</a>、<a href="https://huggingface.co/spaces/Modelflare/coding-agents">Coding Agents</a>、<a href="https://huggingface.co/spaces/Modelflare/api-recipes">API Recipes</a>。可互动 Chat Demo 需 HF PRO 后上线;现在请用控制台 + API。欢迎在 <a href="https://huggingface.co/spaces/Modelflare/start/discussions/1">讨论 #1</a> 留言。</div>
|
| 87 |
-
<p class="foot">Org:<a href="https://huggingface.co/Modelflare">huggingface.co/Modelflare</a> · Docs:<a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=start">docs.modelflare.dev</a></p>
|
| 88 |
-
</section>
|
| 89 |
-
|
| 90 |
-
<section id="en" class="hidden">
|
| 91 |
<div class="badge">Hugging Face × Modelflare</div>
|
| 92 |
<h1>Stable, lower-cost AI API gateway</h1>
|
| 93 |
<p class="lead">One key for LLM, image, and video. OpenAI-compatible chat — point your SDK at <code>https://modelflare.dev/v1</code>, with group failover and per-request cost tracking.</p>
|
|
@@ -97,6 +57,7 @@ print(r.choices[0].message.content)</code></pre>
|
|
| 97 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_blank" rel="noopener">SDK one-line guide</a>
|
| 98 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_blank" rel="noopener">Coding Agents</a>
|
| 99 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_blank" rel="noopener">API Recipes</a>
|
|
|
|
| 100 |
<a class="btn ghost" href="https://huggingface.co/collections/Modelflare/modelflare-getting-started" target="_blank" rel="noopener">Getting Started</a>
|
| 101 |
<a class="btn ghost" href="https://huggingface.co/datasets/Modelflare/api-examples" target="_blank" rel="noopener">Examples dataset</a>
|
| 102 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/start/discussions/1" target="_blank" rel="noopener">Discussion #1</a>
|
|
@@ -110,35 +71,29 @@ print(r.choices[0].message.content)</code></pre>
|
|
| 110 |
<pre><button class="copy" type="button">Copy</button><code>from openai import OpenAI
|
| 111 |
|
| 112 |
client = OpenAI(
|
| 113 |
-
api_key="
|
| 114 |
base_url="https://modelflare.dev/v1",
|
| 115 |
)
|
| 116 |
|
| 117 |
r = client.chat.completions.create(
|
| 118 |
-
model="
|
| 119 |
messages=[{"role": "user", "content": "Hello from Hugging Face"}],
|
| 120 |
)
|
| 121 |
print(r.choices[0].message.content)</code></pre>
|
| 122 |
-
<div class="note"><strong>Coming from Hub?</strong> Grab a key, then follow the <a href="https://huggingface.co/spaces/Modelflare/openai-sdk">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
<p class="foot">Org: <a href="https://huggingface.co/Modelflare">huggingface.co/Modelflare</a> · Docs: <a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=start">docs.modelflare.dev</a></p>
|
| 124 |
</section>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
<script>
|
| 128 |
-
const zh=document.getElementById('zh'), en=document.getElementById('en');
|
| 129 |
-
document.querySelectorAll('.lang button').forEach(btn=>{
|
| 130 |
-
btn.addEventListener('click',()=>{
|
| 131 |
-
document.querySelectorAll('.lang button').forEach(b=>b.classList.remove('on'));
|
| 132 |
-
btn.classList.add('on');
|
| 133 |
-
const l=btn.dataset.lang;
|
| 134 |
-
zh.classList.toggle('hidden',l!=='zh');
|
| 135 |
-
en.classList.toggle('hidden',l!=='en');
|
| 136 |
-
});
|
| 137 |
-
});
|
| 138 |
document.querySelectorAll('pre .copy').forEach(btn=>{
|
| 139 |
btn.addEventListener('click',async()=>{
|
| 140 |
const code=btn.parentElement.querySelector('code').innerText;
|
| 141 |
-
try{await navigator.clipboard.writeText(code);const t=btn.textContent;btn.textContent=
|
| 142 |
});
|
| 143 |
});
|
| 144 |
</script>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
| 46 |
</head>
|
| 47 |
<body>
|
| 48 |
<div class="wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
<section id="en">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
<div class="badge">Hugging Face × Modelflare</div>
|
| 52 |
<h1>Stable, lower-cost AI API gateway</h1>
|
| 53 |
<p class="lead">One key for LLM, image, and video. OpenAI-compatible chat — point your SDK at <code>https://modelflare.dev/v1</code>, with group failover and per-request cost tracking.</p>
|
|
|
|
| 57 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/openai-sdk" target="_blank" rel="noopener">SDK one-line guide</a>
|
| 58 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/coding-agents" target="_blank" rel="noopener">Coding Agents</a>
|
| 59 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/api-recipes" target="_blank" rel="noopener">API Recipes</a>
|
| 60 |
+
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/blog" target="_blank" rel="noopener">Blog</a>
|
| 61 |
<a class="btn ghost" href="https://huggingface.co/collections/Modelflare/modelflare-getting-started" target="_blank" rel="noopener">Getting Started</a>
|
| 62 |
<a class="btn ghost" href="https://huggingface.co/datasets/Modelflare/api-examples" target="_blank" rel="noopener">Examples dataset</a>
|
| 63 |
<a class="btn ghost" href="https://huggingface.co/spaces/Modelflare/start/discussions/1" target="_blank" rel="noopener">Discussion #1</a>
|
|
|
|
| 71 |
<pre><button class="copy" type="button">Copy</button><code>from openai import OpenAI
|
| 72 |
|
| 73 |
client = OpenAI(
|
| 74 |
+
api_key="YOUR_MODELFLARE_API_KEY",
|
| 75 |
base_url="https://modelflare.dev/v1",
|
| 76 |
)
|
| 77 |
|
| 78 |
r = client.chat.completions.create(
|
| 79 |
+
model="gpt-5.6-sol",
|
| 80 |
messages=[{"role": "user", "content": "Hello from Hugging Face"}],
|
| 81 |
)
|
| 82 |
print(r.choices[0].message.content)</code></pre>
|
| 83 |
+
<div class="note"><strong>Coming from Hub?</strong> Grab a key, then follow the <a href="https://huggingface.co/spaces/Modelflare/openai-sdk">SDK guide</a>, <a href="https://huggingface.co/spaces/Modelflare/coding-agents">Coding Agents</a>, and <a href="https://huggingface.co/spaces/Modelflare/api-recipes">API Recipes</a>. Interactive Chat Demo needs HF PRO; use console + API for now. Feedback welcome in <a href="https://huggingface.co/spaces/Modelflare/start/discussions/1">discussion #1</a>.</div>
|
| 84 |
+
<h2 style="margin-top:28px">Blog</h2>
|
| 85 |
+
<div class="grid">
|
| 86 |
+
<div class="card"><h3><a href="https://huggingface.co/spaces/Modelflare/blog">Modelflare Blog</a></h3><p>Setup guides and engineering notes: one key for text, image, and video; the OpenAI SDK switch; coding agents; streaming, fallback, and async video; Smart API Keys; usage and cost records; Media Skill; Castaly.</p></div>
|
| 87 |
+
</div>
|
| 88 |
<p class="foot">Org: <a href="https://huggingface.co/Modelflare">huggingface.co/Modelflare</a> · Docs: <a href="https://docs.modelflare.dev/?utm_source=huggingface&utm_medium=space&utm_campaign=start">docs.modelflare.dev</a></p>
|
| 89 |
</section>
|
| 90 |
</div>
|
| 91 |
|
| 92 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
document.querySelectorAll('pre .copy').forEach(btn=>{
|
| 94 |
btn.addEventListener('click',async()=>{
|
| 95 |
const code=btn.parentElement.querySelector('code').innerText;
|
| 96 |
+
try{await navigator.clipboard.writeText(code);const t=btn.textContent;btn.textContent='Copied';setTimeout(()=>btn.textContent=t,1200)}catch(_){}
|
| 97 |
});
|
| 98 |
});
|
| 99 |
</script>
|