-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_documentation.html
More file actions
235 lines (223 loc) · 8.78 KB
/
api_documentation.html
File metadata and controls
235 lines (223 loc) · 8.78 KB
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
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Optimization Platform API Documentation</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@5.10.3/swagger-ui.css" />
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin:0;
background: #fafafa;
}
.swagger-ui .topbar {
background-color: #2c3e50;
}
.swagger-ui .topbar .download-url-wrapper .select-label {
color: #ffffff;
}
.swagger-ui .info .title {
color: #2c3e50;
}
.custom-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
text-align: center;
margin-bottom: 0;
}
.custom-header h1 {
margin: 0;
font-size: 2.5em;
font-weight: 300;
}
.custom-header p {
margin: 10px 0 0 0;
font-size: 1.2em;
opacity: 0.9;
}
.api-info {
background: white;
padding: 20px;
margin: 0;
border-bottom: 1px solid #e0e0e0;
}
.api-info h2 {
color: #2c3e50;
margin-top: 0;
}
.quick-links {
display: flex;
gap: 15px;
margin-top: 15px;
flex-wrap: wrap;
}
.quick-link {
background: #3498db;
color: white;
padding: 8px 16px;
text-decoration: none;
border-radius: 4px;
font-size: 14px;
transition: background-color 0.3s;
}
.quick-link:hover {
background: #2980b9;
color: white;
}
.auth-info {
background: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 4px;
padding: 15px;
margin: 15px 0;
}
.auth-info h3 {
margin-top: 0;
color: #495057;
}
.code-example {
background: #2c3e50;
color: #ecf0f1;
padding: 10px;
border-radius: 4px;
font-family: 'Courier New', monospace;
font-size: 14px;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="custom-header">
<h1>LLM Optimization Platform</h1>
<p>Comprehensive API for Fine-Tuning & Prompt Optimization</p>
</div>
<div class="api-info">
<h2>API Documentation</h2>
<p>
Welcome to the LLM Optimization Platform API documentation. This platform provides a comprehensive
suite of endpoints for fine-tuning language models, generating text, evaluating prompts, tracking
costs, and monitoring system performance.
</p>
<div class="auth-info">
<h3>🔐 Authentication</h3>
<p>All API endpoints require authentication using an API key. Include your API key in the Authorization header:</p>
<div class="code-example">
Authorization: Bearer YOUR_API_KEY
</div>
<p><strong>Note:</strong> Replace <code>YOUR_API_KEY</code> with your actual API key.</p>
</div>
<h3>🚀 Quick Start</h3>
<div class="quick-links">
<a href="#/Health/get_health" class="quick-link">Health Check</a>
<a href="#/Models/get_models" class="quick-link">List Models</a>
<a href="#/Generation/post_generate" class="quick-link">Generate Text</a>
<a href="#/Cost%20Tracking/post_cost_track" class="quick-link">Track Costs</a>
<a href="#/Monitoring/get_monitoring_health" class="quick-link">System Status</a>
</div>
<h3>📊 Key Features</h3>
<ul>
<li><strong>Text Generation:</strong> Generate text using fine-tuned or commercial models</li>
<li><strong>Model Management:</strong> List and manage available models</li>
<li><strong>Cost Tracking:</strong> Monitor API usage and costs across different models</li>
<li><strong>Human Feedback:</strong> Collect and analyze human ratings for model outputs</li>
<li><strong>System Monitoring:</strong> Real-time monitoring of system performance and alerts</li>
<li><strong>Batch Processing:</strong> Process multiple requests efficiently</li>
</ul>
<h3>🔗 Base URLs</h3>
<ul>
<li><strong>Development:</strong> <code>http://localhost:5000/api/v1</code></li>
<li><strong>Production:</strong> <code>https://api.llm-optimization.com/v1</code></li>
</ul>
<h3>📝 Rate Limits</h3>
<ul>
<li><strong>Text Generation:</strong> 100 requests per minute</li>
<li><strong>Batch Operations:</strong> 10 requests per minute</li>
<li><strong>Other Endpoints:</strong> 1000 requests per minute</li>
</ul>
</div>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5.10.3/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@5.10.3/swagger-ui-standalone-preset.js"></script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: './api_specification.yaml',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
tryItOutEnabled: true,
requestInterceptor: function(request) {
// Add default authorization header if not present
if (!request.headers.Authorization && window.localStorage.getItem('api_key')) {
request.headers.Authorization = 'Bearer ' + window.localStorage.getItem('api_key');
}
return request;
},
onComplete: function() {
// Add custom functionality after Swagger UI loads
console.log('Swagger UI loaded successfully');
// Add API key storage functionality
const authButton = document.createElement('button');
authButton.innerHTML = '🔑 Set API Key';
authButton.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: #3498db;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
z-index: 9999;
font-size: 14px;
`;
authButton.onclick = function() {
const apiKey = prompt('Enter your API key:');
if (apiKey) {
window.localStorage.setItem('api_key', apiKey);
alert('API key saved! It will be automatically included in requests.');
}
};
document.body.appendChild(authButton);
// Show current API key status
if (window.localStorage.getItem('api_key')) {
const statusDiv = document.createElement('div');
statusDiv.innerHTML = '✅ API Key Set';
statusDiv.style.cssText = `
position: fixed;
top: 60px;
right: 20px;
background: #27ae60;
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 12px;
z-index: 9999;
`;
document.body.appendChild(statusDiv);
}
}
});
// End Swagger UI call region
};
</script>
</body>
</html>