Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions examples/speculative-decoding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
"""Example script demonstrating speculative decoding."""

import lmstudio as lms

main_model_key = "qwen2.5-7b-instruct-1m"
draft_model_key = "qwen2.5-0.5b-instruct"

model = lms.llm(main_model_key)
result = model.respond(
"What are the prime numbers between 0 and 100?",
config={
"draftModel": draft_model_key,
}
)

print(result)
stats = result.stats
print(f"Accepted {stats.accepted_draft_tokens_count}/{stats.predicted_tokens_count} tokens")
2 changes: 1 addition & 1 deletion examples/structured-response.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
"""Example script demonstrating an interactive LLM chatbot."""
"""Example script demonstrating structured responses."""

import json

Expand Down
Empty file modified examples/tool-use-multiple.py
100644 → 100755
Empty file.