lemonade-sdk 7.0.4__py3-none-any.whl → 8.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lemonade-sdk might be problematic. Click here for more details.
- lemonade/api.py +3 -3
- lemonade/cli.py +11 -17
- lemonade/common/build.py +0 -47
- lemonade/common/network.py +50 -0
- lemonade/common/status.py +2 -21
- lemonade/common/system_info.py +19 -4
- lemonade/profilers/memory_tracker.py +3 -1
- lemonade/tools/accuracy.py +3 -4
- lemonade/tools/adapter.py +1 -2
- lemonade/tools/{huggingface_bench.py → huggingface/bench.py} +2 -87
- lemonade/tools/huggingface/load.py +235 -0
- lemonade/tools/{huggingface_load.py → huggingface/utils.py} +87 -255
- lemonade/tools/humaneval.py +9 -3
- lemonade/tools/{llamacpp_bench.py → llamacpp/bench.py} +1 -1
- lemonade/tools/{llamacpp.py → llamacpp/load.py} +18 -2
- lemonade/tools/mmlu.py +7 -15
- lemonade/tools/{ort_genai/oga.py → oga/load.py} +31 -422
- lemonade/tools/oga/utils.py +423 -0
- lemonade/tools/perplexity.py +4 -3
- lemonade/tools/prompt.py +2 -1
- lemonade/tools/quark/quark_load.py +2 -1
- lemonade/tools/quark/quark_quantize.py +5 -5
- lemonade/tools/report/table.py +3 -3
- lemonade/tools/server/llamacpp.py +188 -45
- lemonade/tools/server/serve.py +184 -146
- lemonade/tools/server/static/favicon.ico +0 -0
- lemonade/tools/server/static/styles.css +568 -0
- lemonade/tools/server/static/webapp.html +439 -0
- lemonade/tools/server/tray.py +458 -0
- lemonade/tools/server/{port_utils.py → utils/port.py} +22 -3
- lemonade/tools/server/utils/system_tray.py +395 -0
- lemonade/tools/server/{instructions.py → webapp.py} +4 -10
- lemonade/version.py +1 -1
- lemonade_install/install.py +46 -28
- lemonade_sdk-8.0.1.dist-info/METADATA +179 -0
- lemonade_sdk-8.0.1.dist-info/RECORD +70 -0
- lemonade_server/cli.py +182 -27
- lemonade_server/model_manager.py +192 -20
- lemonade_server/pydantic_models.py +9 -4
- lemonade_server/server_models.json +5 -3
- lemonade/common/analyze_model.py +0 -26
- lemonade/common/labels.py +0 -61
- lemonade/common/onnx_helpers.py +0 -176
- lemonade/common/plugins.py +0 -10
- lemonade/common/tensor_helpers.py +0 -83
- lemonade/tools/server/static/instructions.html +0 -262
- lemonade_sdk-7.0.4.dist-info/METADATA +0 -113
- lemonade_sdk-7.0.4.dist-info/RECORD +0 -69
- /lemonade/tools/{ort_genai → oga}/__init__.py +0 -0
- /lemonade/tools/{ort_genai/oga_bench.py → oga/bench.py} +0 -0
- /lemonade/tools/server/{thread_utils.py → utils/thread.py} +0 -0
- {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/WHEEL +0 -0
- {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/entry_points.txt +0 -0
- {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/licenses/LICENSE +0 -0
- {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/licenses/NOTICE.md +0 -0
- {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/top_level.txt +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Helper functions for dealing with tensors
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import os
|
|
6
|
-
import copy
|
|
7
|
-
import torch
|
|
8
|
-
import numpy as np
|
|
9
|
-
import lemonade.common.exceptions as exp
|
|
10
|
-
import lemonade.common.build as build
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Checks whether a given input has the expected shape
|
|
14
|
-
def check_shapes_and_dtypes(
|
|
15
|
-
inputs, expected_shapes, expected_dtypes, expect_downcast=False, raise_error=True
|
|
16
|
-
):
|
|
17
|
-
current_shapes, current_dtypes = build.get_shapes_and_dtypes(inputs)
|
|
18
|
-
|
|
19
|
-
# If we are modifying the data type of inputs on a later tool we
|
|
20
|
-
# verify input type based on the future data type conversion
|
|
21
|
-
if expect_downcast:
|
|
22
|
-
for key, value in current_dtypes.items():
|
|
23
|
-
if value == "float32":
|
|
24
|
-
current_dtypes[key] = "float16"
|
|
25
|
-
elif value == "int64":
|
|
26
|
-
current_dtypes[key] = "int32"
|
|
27
|
-
|
|
28
|
-
input_shapes_changed = expected_shapes != current_shapes
|
|
29
|
-
input_dtypes_changed = expected_dtypes != current_dtypes
|
|
30
|
-
|
|
31
|
-
if input_shapes_changed and raise_error:
|
|
32
|
-
msg = f"""
|
|
33
|
-
Model built to always take input of shape
|
|
34
|
-
{expected_shapes} but got {current_shapes}
|
|
35
|
-
"""
|
|
36
|
-
raise exp.Error(msg)
|
|
37
|
-
elif input_dtypes_changed and raise_error:
|
|
38
|
-
msg = f"""
|
|
39
|
-
Model built to always take input of types
|
|
40
|
-
{expected_dtypes} but got {current_dtypes}
|
|
41
|
-
"""
|
|
42
|
-
raise exp.Error(msg)
|
|
43
|
-
|
|
44
|
-
return input_shapes_changed, input_dtypes_changed
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def save_inputs(inputs, inputs_file, input_dtypes=None, downcast=True):
|
|
48
|
-
|
|
49
|
-
# Detach and downcast inputs
|
|
50
|
-
inputs_converted = copy.deepcopy(inputs)
|
|
51
|
-
for i in range(len(inputs_converted)):
|
|
52
|
-
inputs_converted[i] = {
|
|
53
|
-
k: v for k, v in inputs_converted[i].items() if v is not None
|
|
54
|
-
}
|
|
55
|
-
for k in inputs_converted[i].keys():
|
|
56
|
-
if not hasattr(inputs_converted[i][k], "dtype"):
|
|
57
|
-
continue
|
|
58
|
-
if torch.is_tensor(inputs_converted[i][k]):
|
|
59
|
-
inputs_converted[i][k] = inputs_converted[i][k].cpu().detach().numpy()
|
|
60
|
-
if downcast:
|
|
61
|
-
if input_dtypes is not None and input_dtypes[k] is not None:
|
|
62
|
-
inputs_converted[i][k] = inputs_converted[i][k].astype(
|
|
63
|
-
input_dtypes[k]
|
|
64
|
-
)
|
|
65
|
-
continue
|
|
66
|
-
if (
|
|
67
|
-
inputs_converted[i][k].dtype == np.float32
|
|
68
|
-
or inputs_converted[i][k].dtype == np.float64
|
|
69
|
-
):
|
|
70
|
-
inputs_converted[i][k] = inputs_converted[i][k].astype("float16")
|
|
71
|
-
if inputs_converted[i][k].dtype == np.int64:
|
|
72
|
-
inputs_converted[i][k] = inputs_converted[i][k].astype("int32")
|
|
73
|
-
|
|
74
|
-
# Save models inputs to file for later profiling
|
|
75
|
-
if os.path.isfile(inputs_file):
|
|
76
|
-
os.remove(inputs_file)
|
|
77
|
-
np.save(inputs_file, inputs_converted)
|
|
78
|
-
|
|
79
|
-
return inputs_converted
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# This file was originally licensed under Apache 2.0. It has been modified.
|
|
83
|
-
# Modifications Copyright (c) 2025 AMD
|
|
@@ -1,262 +0,0 @@
|
|
|
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.0">
|
|
6
|
-
<title>Lemonade Server</title>
|
|
7
|
-
<link rel="icon" href="data:,">
|
|
8
|
-
<link rel="stylesheet" href="/static/styles.css">
|
|
9
|
-
<script>
|
|
10
|
-
window.SERVER_PORT = {{SERVER_PORT}};
|
|
11
|
-
</script>
|
|
12
|
-
{{SERVER_MODELS_JS}}
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<nav class="navbar">
|
|
16
|
-
<a href="https://github.com/lemonade-sdk/lemonade">GitHub</a>
|
|
17
|
-
<a href="https://lemonade-server.ai/docs/">Docs</a>
|
|
18
|
-
<a href="https://lemonade-server.ai/docs/server/server_models/">Models</a>
|
|
19
|
-
<a href="https://lemonade-server.ai/docs/server/apps/">Featured Apps</a>
|
|
20
|
-
</nav>
|
|
21
|
-
<main class="main">
|
|
22
|
-
<div class="title">🍋 Lemonade Server</div>
|
|
23
|
-
<div class="tab-container">
|
|
24
|
-
<div class="tabs">
|
|
25
|
-
<button class="tab active" id="tab-chat" onclick="showTab('chat')">LLM Chat</button>
|
|
26
|
-
<button class="tab" id="tab-models" onclick="showTab('models')">Model Management</button>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="tab-content active" id="content-chat">
|
|
29
|
-
<div class="chat-container">
|
|
30
|
-
<div class="chat-history" id="chat-history"></div>
|
|
31
|
-
<div class="chat-input-row">
|
|
32
|
-
<select id="model-select"></select>
|
|
33
|
-
<input type="text" id="chat-input" placeholder="Type your message..." />
|
|
34
|
-
<button id="send-btn">Send</button>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="tab-content" id="content-models">
|
|
39
|
-
<div class="model-mgmt-container">
|
|
40
|
-
<div class="model-mgmt-pane">
|
|
41
|
-
<h3>Installed Models</h3>
|
|
42
|
-
<table class="model-table" id="installed-models-table">
|
|
43
|
-
<colgroup><col style="width:100%"></colgroup>
|
|
44
|
-
<tbody id="installed-models-tbody"></tbody>
|
|
45
|
-
</table>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="model-mgmt-pane">
|
|
48
|
-
<h3>Suggested Models</h3>
|
|
49
|
-
<table class="model-table" id="suggested-models-table">
|
|
50
|
-
<tbody id="suggested-models-tbody"></tbody>
|
|
51
|
-
</table>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</main>
|
|
57
|
-
<footer class="site-footer">
|
|
58
|
-
<div class="dad-joke">When life gives you LLMs, make an LLM aide.</div>
|
|
59
|
-
<div class="copyright">Copyright 2025 AMD</div>
|
|
60
|
-
</footer>
|
|
61
|
-
<script src="https://cdn.jsdelivr.net/npm/openai@4.21.0/dist/openai.min.js"></script>
|
|
62
|
-
<script>
|
|
63
|
-
// Tab switching logic
|
|
64
|
-
function showTab(tab) {
|
|
65
|
-
document.getElementById('tab-chat').classList.remove('active');
|
|
66
|
-
document.getElementById('tab-models').classList.remove('active');
|
|
67
|
-
document.getElementById('content-chat').classList.remove('active');
|
|
68
|
-
document.getElementById('content-models').classList.remove('active');
|
|
69
|
-
if (tab === 'chat') {
|
|
70
|
-
document.getElementById('tab-chat').classList.add('active');
|
|
71
|
-
document.getElementById('content-chat').classList.add('active');
|
|
72
|
-
} else {
|
|
73
|
-
document.getElementById('tab-models').classList.add('active');
|
|
74
|
-
document.getElementById('content-models').classList.add('active');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Helper to get server base URL
|
|
79
|
-
function getServerBaseUrl() {
|
|
80
|
-
const port = window.SERVER_PORT || 8000;
|
|
81
|
-
return `http://localhost:${port}`;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Populate model dropdown from /api/v1/models endpoint
|
|
85
|
-
async function loadModels() {
|
|
86
|
-
try {
|
|
87
|
-
const resp = await fetch(getServerBaseUrl() + '/api/v1/models');
|
|
88
|
-
const data = await resp.json();
|
|
89
|
-
const select = document.getElementById('model-select');
|
|
90
|
-
select.innerHTML = '';
|
|
91
|
-
if (!data.data || !Array.isArray(data.data)) {
|
|
92
|
-
select.innerHTML = '<option>No models found (malformed response)</option>';
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (data.data.length === 0) {
|
|
96
|
-
select.innerHTML = '<option>No models available</option>';
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
let defaultIndex = 0;
|
|
100
|
-
data.data.forEach(function(model, index) {
|
|
101
|
-
const modelId = model.id || model.name || model;
|
|
102
|
-
const opt = document.createElement('option');
|
|
103
|
-
opt.value = modelId;
|
|
104
|
-
opt.textContent = modelId;
|
|
105
|
-
if (modelId === 'Llama-3.2-1B-Instruct-Hybrid') {
|
|
106
|
-
defaultIndex = index;
|
|
107
|
-
}
|
|
108
|
-
select.appendChild(opt);
|
|
109
|
-
});
|
|
110
|
-
select.selectedIndex = defaultIndex;
|
|
111
|
-
} catch (e) {
|
|
112
|
-
const select = document.getElementById('model-select');
|
|
113
|
-
select.innerHTML = `<option>Error loading models: ${e.message}</option>`;
|
|
114
|
-
console.error('Error loading models:', e);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
loadModels();
|
|
118
|
-
|
|
119
|
-
// Model Management Tab Logic
|
|
120
|
-
async function refreshModelMgmtUI() {
|
|
121
|
-
// Get installed models from /api/v1/models
|
|
122
|
-
let installed = [];
|
|
123
|
-
try {
|
|
124
|
-
const resp = await fetch(getServerBaseUrl() + '/api/v1/models');
|
|
125
|
-
const data = await resp.json();
|
|
126
|
-
if (data.data && Array.isArray(data.data)) {
|
|
127
|
-
installed = data.data.map(m => m.id || m.name || m);
|
|
128
|
-
}
|
|
129
|
-
} catch (e) {}
|
|
130
|
-
// All models from server_models.json (window.SERVER_MODELS)
|
|
131
|
-
const allModels = window.SERVER_MODELS || {};
|
|
132
|
-
// Filter suggested models not installed
|
|
133
|
-
const suggested = Object.keys(allModels).filter(
|
|
134
|
-
k => allModels[k].suggested && !installed.includes(k)
|
|
135
|
-
);
|
|
136
|
-
// Render installed models as a table (two columns, second is invisible)
|
|
137
|
-
const installedTbody = document.getElementById('installed-models-tbody');
|
|
138
|
-
installedTbody.innerHTML = '';
|
|
139
|
-
installed.forEach(function(mid) {
|
|
140
|
-
var tr = document.createElement('tr');
|
|
141
|
-
var tdName = document.createElement('td');
|
|
142
|
-
tdName.textContent = mid;
|
|
143
|
-
var tdEmpty = document.createElement('td');
|
|
144
|
-
tdEmpty.style.width = '0';
|
|
145
|
-
tdEmpty.style.padding = '0';
|
|
146
|
-
tdEmpty.style.border = 'none';
|
|
147
|
-
tr.appendChild(tdName);
|
|
148
|
-
tr.appendChild(tdEmpty);
|
|
149
|
-
installedTbody.appendChild(tr);
|
|
150
|
-
});
|
|
151
|
-
// Render suggested models as a table
|
|
152
|
-
const suggestedTbody = document.getElementById('suggested-models-tbody');
|
|
153
|
-
suggestedTbody.innerHTML = '';
|
|
154
|
-
suggested.forEach(mid => {
|
|
155
|
-
const tr = document.createElement('tr');
|
|
156
|
-
const tdName = document.createElement('td');
|
|
157
|
-
tdName.textContent = mid;
|
|
158
|
-
tdName.style.paddingRight = '1em';
|
|
159
|
-
tdName.style.verticalAlign = 'middle';
|
|
160
|
-
const tdBtn = document.createElement('td');
|
|
161
|
-
tdBtn.style.width = '1%';
|
|
162
|
-
tdBtn.style.verticalAlign = 'middle';
|
|
163
|
-
const btn = document.createElement('button');
|
|
164
|
-
btn.textContent = '+';
|
|
165
|
-
btn.title = 'Install model';
|
|
166
|
-
btn.onclick = async function() {
|
|
167
|
-
btn.disabled = true;
|
|
168
|
-
btn.textContent = 'Installing...';
|
|
169
|
-
btn.classList.add('installing-btn');
|
|
170
|
-
try {
|
|
171
|
-
await fetch(getServerBaseUrl() + '/api/v1/pull', {
|
|
172
|
-
method: 'POST',
|
|
173
|
-
headers: { 'Content-Type': 'application/json' },
|
|
174
|
-
body: JSON.stringify({ model_name: mid })
|
|
175
|
-
});
|
|
176
|
-
await refreshModelMgmtUI();
|
|
177
|
-
await loadModels(); // update chat dropdown too
|
|
178
|
-
} catch (e) {
|
|
179
|
-
btn.textContent = 'Error';
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
tdBtn.appendChild(btn);
|
|
183
|
-
tr.appendChild(tdName);
|
|
184
|
-
tr.appendChild(tdBtn);
|
|
185
|
-
suggestedTbody.appendChild(tr);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
// Initial load
|
|
189
|
-
refreshModelMgmtUI();
|
|
190
|
-
// Optionally, refresh when switching to the tab
|
|
191
|
-
document.getElementById('tab-models').addEventListener('click', refreshModelMgmtUI);
|
|
192
|
-
|
|
193
|
-
// Chat logic (streaming with OpenAI JS client placeholder)
|
|
194
|
-
const chatHistory = document.getElementById('chat-history');
|
|
195
|
-
const chatInput = document.getElementById('chat-input');
|
|
196
|
-
const sendBtn = document.getElementById('send-btn');
|
|
197
|
-
const modelSelect = document.getElementById('model-select');
|
|
198
|
-
let messages = [];
|
|
199
|
-
|
|
200
|
-
function appendMessage(role, text) {
|
|
201
|
-
const div = document.createElement('div');
|
|
202
|
-
div.className = 'chat-message ' + role;
|
|
203
|
-
// Add a bubble for iMessage style
|
|
204
|
-
const bubble = document.createElement('div');
|
|
205
|
-
bubble.className = 'chat-bubble ' + role;
|
|
206
|
-
bubble.innerHTML = text;
|
|
207
|
-
div.appendChild(bubble);
|
|
208
|
-
chatHistory.appendChild(div);
|
|
209
|
-
chatHistory.scrollTop = chatHistory.scrollHeight;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
async function sendMessage() {
|
|
213
|
-
const text = chatInput.value.trim();
|
|
214
|
-
if (!text) return;
|
|
215
|
-
appendMessage('user', text);
|
|
216
|
-
messages.push({ role: 'user', content: text });
|
|
217
|
-
chatInput.value = '';
|
|
218
|
-
sendBtn.disabled = true;
|
|
219
|
-
// Streaming OpenAI completions (placeholder, adapt as needed)
|
|
220
|
-
let llmText = '';
|
|
221
|
-
appendMessage('llm', '...');
|
|
222
|
-
const llmDiv = chatHistory.lastChild.querySelector('.chat-bubble.llm');
|
|
223
|
-
try {
|
|
224
|
-
// Use the correct endpoint for chat completions
|
|
225
|
-
const resp = await fetch(getServerBaseUrl() + '/api/v1/chat/completions', {
|
|
226
|
-
method: 'POST',
|
|
227
|
-
headers: { 'Content-Type': 'application/json' },
|
|
228
|
-
body: JSON.stringify({
|
|
229
|
-
model: modelSelect.value,
|
|
230
|
-
messages: messages,
|
|
231
|
-
stream: true
|
|
232
|
-
})
|
|
233
|
-
});
|
|
234
|
-
if (!resp.body) throw new Error('No stream');
|
|
235
|
-
const reader = resp.body.getReader();
|
|
236
|
-
let decoder = new TextDecoder();
|
|
237
|
-
llmDiv.textContent = '';
|
|
238
|
-
while (true) {
|
|
239
|
-
const { done, value } = await reader.read();
|
|
240
|
-
if (done) break;
|
|
241
|
-
const chunk = decoder.decode(value);
|
|
242
|
-
if (chunk.trim() === 'data: [DONE]' || chunk.trim() === '[DONE]') continue;
|
|
243
|
-
// Try to extract the content from the OpenAI chunk
|
|
244
|
-
const match = chunk.match(/"content"\s*:\s*"([^"]*)"/);
|
|
245
|
-
if (match && match[1]) {
|
|
246
|
-
llmText += match[1];
|
|
247
|
-
llmDiv.textContent = llmText;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
messages.push({ role: 'assistant', content: llmText });
|
|
251
|
-
} catch (e) {
|
|
252
|
-
llmDiv.textContent = '[Error: ' + e.message + ']';
|
|
253
|
-
}
|
|
254
|
-
sendBtn.disabled = false;
|
|
255
|
-
}
|
|
256
|
-
sendBtn.onclick = sendMessage;
|
|
257
|
-
chatInput.addEventListener('keydown', function(e) {
|
|
258
|
-
if (e.key === 'Enter') sendMessage();
|
|
259
|
-
});
|
|
260
|
-
</script>
|
|
261
|
-
</body>
|
|
262
|
-
</html>
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: lemonade-sdk
|
|
3
|
-
Version: 7.0.4
|
|
4
|
-
Summary: Lemonade SDK: Your LLM Aide for Validation and Deployment
|
|
5
|
-
Author-email: lemonade@amd.com
|
|
6
|
-
Requires-Python: >=3.10, <3.12
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
License-File: NOTICE.md
|
|
10
|
-
Requires-Dist: invoke>=2.0.0
|
|
11
|
-
Requires-Dist: onnx<1.18.0,>=1.11.0
|
|
12
|
-
Requires-Dist: torch>=1.12.1
|
|
13
|
-
Requires-Dist: pyyaml>=5.4
|
|
14
|
-
Requires-Dist: typeguard>=2.3.13
|
|
15
|
-
Requires-Dist: packaging>=20.9
|
|
16
|
-
Requires-Dist: numpy<2.0.0
|
|
17
|
-
Requires-Dist: pandas>=1.5.3
|
|
18
|
-
Requires-Dist: fasteners
|
|
19
|
-
Requires-Dist: GitPython>=3.1.40
|
|
20
|
-
Requires-Dist: psutil>=6.1.1
|
|
21
|
-
Requires-Dist: wmi
|
|
22
|
-
Requires-Dist: pytz
|
|
23
|
-
Requires-Dist: zstandard
|
|
24
|
-
Requires-Dist: matplotlib
|
|
25
|
-
Requires-Dist: tabulate
|
|
26
|
-
Requires-Dist: huggingface-hub==0.30.2
|
|
27
|
-
Provides-Extra: llm
|
|
28
|
-
Requires-Dist: torch>=2.6.0; extra == "llm"
|
|
29
|
-
Requires-Dist: transformers<=4.51.3; extra == "llm"
|
|
30
|
-
Requires-Dist: accelerate; extra == "llm"
|
|
31
|
-
Requires-Dist: py-cpuinfo; extra == "llm"
|
|
32
|
-
Requires-Dist: sentencepiece; extra == "llm"
|
|
33
|
-
Requires-Dist: datasets; extra == "llm"
|
|
34
|
-
Requires-Dist: human-eval-windows==1.0.4; extra == "llm"
|
|
35
|
-
Requires-Dist: fastapi; extra == "llm"
|
|
36
|
-
Requires-Dist: uvicorn[standard]; extra == "llm"
|
|
37
|
-
Requires-Dist: openai>=1.81.0; extra == "llm"
|
|
38
|
-
Requires-Dist: lm-eval[api]; extra == "llm"
|
|
39
|
-
Provides-Extra: llm-oga-cpu
|
|
40
|
-
Requires-Dist: onnxruntime-genai==0.6.0; extra == "llm-oga-cpu"
|
|
41
|
-
Requires-Dist: onnxruntime<1.22.0,>=1.10.1; extra == "llm-oga-cpu"
|
|
42
|
-
Requires-Dist: lemonade-sdk[llm]; extra == "llm-oga-cpu"
|
|
43
|
-
Provides-Extra: llm-oga-igpu
|
|
44
|
-
Requires-Dist: onnxruntime-genai-directml==0.6.0; extra == "llm-oga-igpu"
|
|
45
|
-
Requires-Dist: onnxruntime-directml<1.22.0,>=1.19.0; extra == "llm-oga-igpu"
|
|
46
|
-
Requires-Dist: transformers<4.45.0; extra == "llm-oga-igpu"
|
|
47
|
-
Requires-Dist: lemonade-sdk[llm]; extra == "llm-oga-igpu"
|
|
48
|
-
Provides-Extra: llm-oga-cuda
|
|
49
|
-
Requires-Dist: onnxruntime-genai-cuda==0.6.0; extra == "llm-oga-cuda"
|
|
50
|
-
Requires-Dist: onnxruntime-gpu<1.22.0,>=1.19.1; extra == "llm-oga-cuda"
|
|
51
|
-
Requires-Dist: transformers<4.45.0; extra == "llm-oga-cuda"
|
|
52
|
-
Requires-Dist: lemonade-sdk[llm]; extra == "llm-oga-cuda"
|
|
53
|
-
Provides-Extra: llm-oga-npu
|
|
54
|
-
Requires-Dist: onnx==1.16.0; extra == "llm-oga-npu"
|
|
55
|
-
Requires-Dist: onnxruntime==1.18.0; extra == "llm-oga-npu"
|
|
56
|
-
Requires-Dist: numpy==1.26.4; extra == "llm-oga-npu"
|
|
57
|
-
Requires-Dist: protobuf>=6.30.1; extra == "llm-oga-npu"
|
|
58
|
-
Requires-Dist: lemonade-sdk[llm]; extra == "llm-oga-npu"
|
|
59
|
-
Provides-Extra: llm-oga-hybrid
|
|
60
|
-
Requires-Dist: onnx==1.16.1; extra == "llm-oga-hybrid"
|
|
61
|
-
Requires-Dist: numpy==1.26.4; extra == "llm-oga-hybrid"
|
|
62
|
-
Requires-Dist: protobuf>=6.30.1; extra == "llm-oga-hybrid"
|
|
63
|
-
Requires-Dist: lemonade-sdk[llm]; extra == "llm-oga-hybrid"
|
|
64
|
-
Provides-Extra: llm-oga-unified
|
|
65
|
-
Requires-Dist: lemonade-sdk[llm-oga-hybrid]; extra == "llm-oga-unified"
|
|
66
|
-
Dynamic: author-email
|
|
67
|
-
Dynamic: description
|
|
68
|
-
Dynamic: description-content-type
|
|
69
|
-
Dynamic: license-file
|
|
70
|
-
Dynamic: provides-extra
|
|
71
|
-
Dynamic: requires-dist
|
|
72
|
-
Dynamic: requires-python
|
|
73
|
-
Dynamic: summary
|
|
74
|
-
|
|
75
|
-
[](https://github.com/lemonade-sdk/lemonade/tree/main/test "Check out our tests")
|
|
76
|
-
[](docs/README.md#installation "Check out our instructions")
|
|
77
|
-
[](docs/README.md#installation "Check out our instructions")
|
|
78
|
-
|
|
79
|
-
## 🍋 Lemonade SDK: Quickly serve, benchmark and deploy LLMs
|
|
80
|
-
|
|
81
|
-
The [Lemonade SDK](./docs/README.md) is designed to make it easy to serve, benchmark, and deploy large language models (LLMs) on a variety of hardware platforms, including CPU, GPU, and NPU.
|
|
82
|
-
|
|
83
|
-
<div align="center">
|
|
84
|
-
<img src="https://download.amd.com/images/lemonade_640x480_1.gif" alt="Lemonade Demo" title="Lemonade in Action">
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
The [Lemonade SDK](./docs/README.md) is comprised of the following:
|
|
88
|
-
|
|
89
|
-
- 🌐 **Lemonade Server**: A server interface that uses the standard Open AI API, allowing applications to integrate with local LLMs.
|
|
90
|
-
- 🐍 **Lemonade Python API**: Offers High-Level API for easy integration of Lemonade LLMs into Python applications and Low-Level API for custom experiments.
|
|
91
|
-
- 🖥️ **Lemonade CLI**: The `lemonade` CLI lets you mix-and-match LLMs, frameworks (PyTorch, ONNX, GGUF), and measurement tools to run experiments. The available tools are:
|
|
92
|
-
- Prompting an LLM.
|
|
93
|
-
- Measuring the accuracy of an LLM using a variety of tests.
|
|
94
|
-
- Benchmarking an LLM to get the time-to-first-token and tokens per second.
|
|
95
|
-
- Profiling the memory usage of an LLM.
|
|
96
|
-
|
|
97
|
-
### [Click here to get started with Lemonade.](./docs/README.md)
|
|
98
|
-
|
|
99
|
-
## Contributing
|
|
100
|
-
|
|
101
|
-
We are actively seeking collaborators from across the industry. If you would like to contribute to this project, please check out our [contribution guide](./docs/contribute.md).
|
|
102
|
-
|
|
103
|
-
## Maintainers
|
|
104
|
-
|
|
105
|
-
This project is sponsored by AMD. It is maintained by @danielholanda @jeremyfowers @ramkrishna @vgodsoe in equal measure. You can reach us by filing an [issue](https://github.com/lemonade-sdk/lemonade/issues) or email [lemonade@amd.com](mailto:lemonade@amd.com).
|
|
106
|
-
|
|
107
|
-
## License
|
|
108
|
-
|
|
109
|
-
This project is licensed under the [Apache 2.0 License](https://github.com/lemonade-sdk/lemonade/blob/main/LICENSE). Portions of the project are licensed as described in [NOTICE.md](./NOTICE.md).
|
|
110
|
-
|
|
111
|
-
<!--This file was originally licensed under Apache 2.0. It has been modified.
|
|
112
|
-
Modifications Copyright (c) 2025 AMD-->
|
|
113
|
-
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
lemonade/__init__.py,sha256=W1Qk7r0rnQqFhPNHp6BIBT_q-OH3s-8Q_POoVfAmKW0,117
|
|
2
|
-
lemonade/api.py,sha256=9apNWSMS4bYpYl7iqDA4CsHHOOMdjOIuJhNYSqj_jIA,3878
|
|
3
|
-
lemonade/cache.py,sha256=djr2qgyUUAWlQv8FehU9qlNtCwK0IZqo82hcBDyZ3-A,2850
|
|
4
|
-
lemonade/cli.py,sha256=ddN2QqsGMsVwydfcR7MSZu1z8_-bUgUP7dhw9lzbHa8,4424
|
|
5
|
-
lemonade/sequence.py,sha256=KSH7BPsiyDKsOsg_ziQKEGsDwMmuO_YbgPRBxkZd0pw,13267
|
|
6
|
-
lemonade/state.py,sha256=sdSezla7Cd7KYL90xY3p9kcNV4ndSyN6UvNLOr3vBMA,5261
|
|
7
|
-
lemonade/version.py,sha256=aw-kI317_MHnrxmftgwY1GZZgkDfKup4upSzIuUp5yk,22
|
|
8
|
-
lemonade/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
lemonade/common/analyze_model.py,sha256=sYWDznEUEWjx_Qekg7f1hHY4Pfe87IQ77lmsWqePgE0,803
|
|
10
|
-
lemonade/common/build.py,sha256=Pk86mCr6fyBIx2zXDpq0BkdahlCmWRnwSTpShA_gwZw,7849
|
|
11
|
-
lemonade/common/cli_helpers.py,sha256=hjBfXrTtFl8gmCFlL-ksviXR0mOcdPtTWVNKoEp3PG4,4993
|
|
12
|
-
lemonade/common/exceptions.py,sha256=w83sVKmL1QXoJlGjj_bRyjIBMhlMqdVQy_FEOTu2YQI,2050
|
|
13
|
-
lemonade/common/filesystem.py,sha256=QV3cHhKNu-7W2rr8wZ4JQfD2rP_5T2Js7jiDQBYWHVQ,12142
|
|
14
|
-
lemonade/common/labels.py,sha256=0js1Xmj98fkOqERf2Q8MC3utWJj4m1FH428Vmzpwol4,2111
|
|
15
|
-
lemonade/common/onnx_helpers.py,sha256=SxLW3iCBfuHdQNP77-OAwf6HLojqWu28x0Zf6Ayy-7g,6013
|
|
16
|
-
lemonade/common/plugins.py,sha256=YHEI22ATpc9O0s1z5q7pF6Ogo61G8nOMSE8zivoKwao,210
|
|
17
|
-
lemonade/common/printing.py,sha256=GFFzrXIineIOMa9yu0lo5sL4j6A5BBg_T9aUCdP-juw,3229
|
|
18
|
-
lemonade/common/status.py,sha256=1DuS_3srtuIenPi_jFsWCjqCQEUh7Fjz-Mqhm52MHnE,17153
|
|
19
|
-
lemonade/common/system_info.py,sha256=Pndf8sIyG0kELRUw_CkKFphI9YPTrQ5VqwvYWfMLiEI,11661
|
|
20
|
-
lemonade/common/tensor_helpers.py,sha256=XEy2m7FB5Ax70aeNC6PHKb1OtvuTblrNJZScyjaip6Q,2962
|
|
21
|
-
lemonade/common/test_helpers.py,sha256=Gwk-pa_6xYAo2oro-2EJNfuouAfw8k_brCbcMC-E-r0,758
|
|
22
|
-
lemonade/profilers/__init__.py,sha256=JKVonvJ4XZ9_6sKXPWsiMLQCNyzQOxhQw5BEHR1qOfU,31
|
|
23
|
-
lemonade/profilers/memory_tracker.py,sha256=-SSBmNlrweiX59wyNtLMWiwaMOskBzNO1_cufVwteqs,9357
|
|
24
|
-
lemonade/profilers/profiler.py,sha256=y_iMGr1ToQ6rcwcIcXck4ajapisLXCfHggiV-IpPF98,1666
|
|
25
|
-
lemonade/tools/__init__.py,sha256=_6xRc-FHxmujoLjLjWtpYrWYEXtCSneSy-5ya01kyPk,53
|
|
26
|
-
lemonade/tools/accuracy.py,sha256=QndammQ1bmlTaF_6YDaaiJp6fpkKZDYGySdQpAgZIp8,11699
|
|
27
|
-
lemonade/tools/adapter.py,sha256=4H6gfbjvqyU6qm1_-b2FE-c3a7N9OzEBeDVnIwqRDvg,3014
|
|
28
|
-
lemonade/tools/bench.py,sha256=aN5LMA_EH6-ZhAH3Gf26JYL7s0eKpUd3j-bReRhzvEY,10016
|
|
29
|
-
lemonade/tools/huggingface_bench.py,sha256=POE5JYzArK2FBktazOkluLNFzlLctM39B19fK5sMx-0,10017
|
|
30
|
-
lemonade/tools/huggingface_load.py,sha256=857GxaQcqmSv2DSsMh503aSicwQDQg5wGGlpwehHHrg,18868
|
|
31
|
-
lemonade/tools/humaneval.py,sha256=RCkVR-yOL56T4EyURaU3MR3yhU4NCbeuWHDyhVWZtxw,9502
|
|
32
|
-
lemonade/tools/llamacpp.py,sha256=uv-xv5KfHm0eU1I6vEKuaRC-QpilE1FffVA-zoCvHt4,8659
|
|
33
|
-
lemonade/tools/llamacpp_bench.py,sha256=tZamG-1Z5pG_bD4O4yz2mUo2AWwEgOw9RSdEDllW4HY,5941
|
|
34
|
-
lemonade/tools/management_tools.py,sha256=RO-lU-hjZhrP9KD9qcLI7MrLu-Rxnkrxzn45qqwKInE,8554
|
|
35
|
-
lemonade/tools/mmlu.py,sha256=hNa7A8dhpjOtgfd5MGcagpwpw4_AZRZvVj5Duz9LJ88,11381
|
|
36
|
-
lemonade/tools/perplexity.py,sha256=Z6ha7LS5DhdZWHZxhDz8mDnfESbTGc6TGo8KnPjRmiE,5606
|
|
37
|
-
lemonade/tools/prompt.py,sha256=AhRdWpx5BVnuJTmCsxSCw_oKHRlTiRLmOkriXon_mLE,8629
|
|
38
|
-
lemonade/tools/tool.py,sha256=UsxVYukfm_iM3BfeGYPZxQlTK5UfDfDOl3RIyLr8A1Y,13256
|
|
39
|
-
lemonade/tools/ort_genai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
lemonade/tools/ort_genai/oga.py,sha256=dZ6kbwHBVfzTujAG0ojYDhjS8uH6kwW5xZTcu20hFIc,43886
|
|
41
|
-
lemonade/tools/ort_genai/oga_bench.py,sha256=T3c40NevM3NA7CT98B6vBj1nXfdITDqpfMHYSjhjwpA,5061
|
|
42
|
-
lemonade/tools/quark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
-
lemonade/tools/quark/quark_load.py,sha256=QWzhXP8MehgD_KjnsmN5a-3D5kdI2XZtKTH4HoDoFoo,5572
|
|
44
|
-
lemonade/tools/quark/quark_quantize.py,sha256=FkZ33oQoO20fTKOcHqzP0UAkGmD9I4GUrrNbp60hOZc,16567
|
|
45
|
-
lemonade/tools/report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
-
lemonade/tools/report/llm_report.py,sha256=bVHhwCINA-Ok2EdSwAsLubsc83N3KWOVuwTguw7jDcE,6676
|
|
47
|
-
lemonade/tools/report/table.py,sha256=a0TXo1X84RxCSu0un_XM3ANOlhLtPDuqtGwR7eomf2s,24853
|
|
48
|
-
lemonade/tools/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
lemonade/tools/server/instructions.py,sha256=PbQ8HItagIWbJLYf2IVPhthYVi1E878vNdS42qmTc3E,1230
|
|
50
|
-
lemonade/tools/server/llamacpp.py,sha256=YP-vD3H3MRz5lUIggjx5Kf_k9L9jULJVFdePHIkHzQc,10176
|
|
51
|
-
lemonade/tools/server/port_utils.py,sha256=24Ryz5cNU0R9L1kuVSapZoyXTZHzhF4y0Yje9MVOrE0,1535
|
|
52
|
-
lemonade/tools/server/serve.py,sha256=sxQWBA5AqLoZZUuM2nQlEZwomvHYtItgrxFSnLMyy2k,52453
|
|
53
|
-
lemonade/tools/server/thread_utils.py,sha256=pK9K_6DNWoQ78NArkAX3Ym2WsxLnCs9sKTk6TitlYnI,2804
|
|
54
|
-
lemonade/tools/server/tool_calls.py,sha256=xrAlQwKG-nv2xLlf8f9CDSaUbyMn8ZtHkds9iZLG9K8,5230
|
|
55
|
-
lemonade/tools/server/static/instructions.html,sha256=tCkc55LrI4oWQM2VYuK3_m02MvG5XxIcTbCSgxyTAIU,11257
|
|
56
|
-
lemonade/tools/server/static/styles.css,sha256=8U1EejQaqRLQ6QTCF5UG_dLPtLjRwT1menUHMDhaq2M,5045
|
|
57
|
-
lemonade_install/__init__.py,sha256=26zohKg2jgr_5y7tObduWMYQg8zCTWMZHL8lfi2zZVQ,40
|
|
58
|
-
lemonade_install/install.py,sha256=61qUO7kWCLcdjK0_IQZ46-rKP_AWkyznh4YpDclPKyM,28036
|
|
59
|
-
lemonade_sdk-7.0.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
60
|
-
lemonade_sdk-7.0.4.dist-info/licenses/NOTICE.md,sha256=B8lEqi4QE41J9ljz4Riv2JgHD1v8GCZE6nNBHO3KIA0,2135
|
|
61
|
-
lemonade_server/cli.py,sha256=DR6sIt66K1sZZG3ascEw_6HUgz3UhU9KGUyzxf4nO_A,7351
|
|
62
|
-
lemonade_server/model_manager.py,sha256=-r9JS_fPcoLCQCFKZfkInBIIgT4F1tQ_EIKqMqNYpqM,5546
|
|
63
|
-
lemonade_server/pydantic_models.py,sha256=pdOZW6nAYKWKllMLR7y5wdbIofIznxe5Vehac0Hgqto,2276
|
|
64
|
-
lemonade_server/server_models.json,sha256=3C-lJ2lsNwdy0AKT_US_lcVOoiF3xmadbiOUeOQuJXA,6927
|
|
65
|
-
lemonade_sdk-7.0.4.dist-info/METADATA,sha256=pVHSWafYsDczc6dkHFHP8QRmLF_SkEwLeTIqPacek7w,5443
|
|
66
|
-
lemonade_sdk-7.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
67
|
-
lemonade_sdk-7.0.4.dist-info/entry_points.txt,sha256=gJppn0ETtXXR6ceKWEIRdk42kMC7ps59EmU3NCPyPUk,144
|
|
68
|
-
lemonade_sdk-7.0.4.dist-info/top_level.txt,sha256=10ap5GNiPhalO4V50LRoxA1FqRT9g3Xkia6BITu880k,42
|
|
69
|
-
lemonade_sdk-7.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|