File size: 7,797 Bytes
a2f59db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29da6df
a2f59db
 
 
590d18d
 
 
 
 
a2f59db
 
 
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LFM2.5 Embedding API</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
            color: #e5e7eb;
            min-height: 100vh;
            padding: 40px 20px;
            line-height: 1.6;
        }
        .container { max-width: 900px; margin: 0 auto; }
        .hero { text-align: center; padding: 40px 0; }
        .hero h1 {
            font-size: 2.8em;
            background: linear-gradient(90deg, #a78bfa, #f472b6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
        }
        .hero .subtitle { font-size: 1.2em; color: #c7d2fe; margin-bottom: 20px; }
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.4);
            padding: 8px 16px;
            border-radius: 50px;
            font-size: 0.9em;
            color: #6ee7b7;
        }
        .status-dot {
            width: 8px;
            height: 8px;
            background: #10b981;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .card {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);            border-radius: 16px;
            padding: 30px;
            margin-bottom: 20px;
        }
        .card h2 {
            color: #a78bfa;
            margin-bottom: 20px;
            font-size: 1.5em;
        }
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }
        .info-item {
            background: rgba(0, 0, 0, 0.2);
            padding: 15px;
            border-radius: 10px;
            border-left: 3px solid #a78bfa;
        }
        .info-item .label {
            font-size: 0.85em;
            color: #9ca3af;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .info-item .value {
            font-size: 1.1em;
            color: #f3f4f6;
            margin-top: 4px;
            font-weight: 500;
        }
        pre {
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            padding: 20px;
            overflow-x: auto;
            font-family: 'Courier New', monospace;
            font-size: 0.9em;
            color: #d1d5db;
            margin-top: 15px;
        }
        code { color: #fbbf24; }
        a {
            color: #a78bfa;
            text-decoration: none;
            border-bottom: 1px dashed #a78bfa;
        }        a:hover { color: #f472b6; border-bottom-color: #f472b6; }
        .endpoint {
            display: inline-block;
            background: #10b981;
            color: white;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.8em;
            font-weight: bold;
            margin-right: 8px;
        }
        .footer {
            text-align: center;
            padding: 30px 0;
            color: #9ca3af;
            font-size: 0.9em;
        }
        .btn {
            display: inline-block;
            background: linear-gradient(90deg, #a78bfa, #f472b6);
            color: white;
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: 500;
            margin-top: 15px;
            border: none;
        }
        .btn:hover { opacity: 0.9; }
    </style>
</head>
<body>
    <div class="container">
        <div class="hero">
            <h1>🧠 LFM2.5 Embedding API</h1>
            <p class="subtitle">OpenAI-compatible embeddings running on pure CPU</p>
            <div class="status-badge">
                <span class="status-dot"></span>
                <span>Operational</span>
            </div>
        </div>

        <div class="card">
            <h2>πŸ“Š Model Information</h2>
            <div class="grid">
                <div class="info-item">
                    <div class="label">Model</div>
                    <div class="value">LFM2.5-Embedding-350M</div>
                </div>
                <div class="info-item">
                    <div class="label">Provider</div>                    <div class="value">Liquid AI</div>
                </div>
                <div class="info-item">
                    <div class="label">Dimensions</div>
                    <div class="value">1024 floats</div>
                </div>
                <div class="info-item">
                    <div class="label">Context</div>
                    <div class="value">512 tokens</div>
                </div>
                <div class="info-item">
                    <div class="label">Quantization</div>
                    <div class="value">Q8_0 (GGUF)</div>
                </div>
                <div class="info-item">
                    <div class="label">Engine</div>
                    <div class="value">llama.cpp (CPU)</div>
                </div>
            </div>
        </div>

        <div class="card">
            <h2>πŸ”Œ Endpoint</h2>
            <p><span class="endpoint">POST</span><code>/v1/embeddings</code></p>
            <p style="margin-top: 15px;">Compatible with OpenAI SDK, LangChain, LlamaIndex, Open WebUI, Cursor, OpenClaw, and more.</p>
        </div>

        <div class="card">
            <h2>πŸš€ Quick Start (cURL)</h2>
            <pre><code>curl -X POST "https://YOUR-SPACE.hf.space/v1/embeddings" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your text here",
    "model": "LiquidAI/LFM2.5-Embedding-350M",
    "input_type": "document"
  }'</code></pre>
        </div>

        <div class="card">
            <h2>🐍 Python Example</h2>
            <pre><code>from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://YOUR-SPACE.hf.space/v1/"
)

response = client.embeddings.create(
    model="LiquidAI/LFM2.5-Embedding-350M",    input="Your text here",
    extra_body={"input_type": "document"}
)

print(response.data[0].embedding[:5])</code></pre>
        </div>

        <div class="card">
            <h2>πŸ” Authentication</h2>
            <p>All requests require a Bearer token:</p>
            <pre><code>Authorization: Bearer YOUR_API_KEY</code></pre>
        </div>

        <div class="card" style="text-align: center;">
            <h2>πŸ“š Documentation</h2>
            <p>For complete setup instructions and licensing:</p>
            <a href="https://huggingface.co/spaces/Edu014/LFM2.5-Embedding/blob/main/README.md" target="_blank" rel="noopener">View README β†’</a>
        <div class="footer">
            <p>Built with ❀️ for the RAG community</p>
            <p style="margin-top: 8px; font-size: 0.85em;">
        Powered by <a href="https://www.liquid.ai" target="_blank" rel="noopener">Liquid AI</a> β€’ 
        <a href="https://github.com/ggerganov/llama.cpp" target="_blank" rel="noopener">llama.cpp</a> β€’ 
        <a href="https://fastapi.tiangolo.com" target="_blank" rel="noopener">FastAPI</a>
         </p>
      </div>
    </div>
</body>
</html>