You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update LMNT example project: Revise README for clarity on LMNT voice generation, adjust workflow scheduling functions, and enhance service rate limits for improved performance.
When running multiple workflows in parallel, managing the rate limit for LLM functions is crucial. Here are common strategies:
23
+
When running multiple workflows in parallel, managing the rate limit for LMNT functions is crucial. Here are common strategies:
29
24
30
-
1.**Task Queue**: Use a task queue (e.g., Celery, RabbitMQ) to schedule LLM calls, ensuring only one is processed at a time.
25
+
1.**Task Queue**: Use a task queue (e.g., Celery, RabbitMQ) to schedule LMNT calls, ensuring only one is processed at a time.
31
26
2.**Rate Limiting Middleware**: Implement middleware to queue requests and process them at the allowed rate.
32
-
3.**Semaphore or Locking**: Use a semaphore or lock to control access, ensuring only one LLM function runs per second.
27
+
3.**Semaphore or Locking**: Use a semaphore or lock to control access, ensuring only one LMNT function runs per second.
33
28
34
29
### With Restack
35
30
36
31
Restack automates rate limit management, eliminating the need for manual strategies. Define the rate limit in the service options, and Restack handles queuing and execution:
37
32
38
33
```python
39
34
client.start_service(
40
-
task_queue="llm",
41
-
functions=[llm_generate, llm_evaluate],
35
+
task_queue="lmnt",
36
+
functions=[lmnt_list_voices, lmnt_synthesize],
42
37
options=ServiceOptions(
43
38
rate_limit=1,
44
39
max_concurrent_function_runs=1
@@ -63,13 +58,7 @@ And for each child workflow, for each step you can see how long the function sta
63
58
- Python 3.10 or higher
64
59
- Poetry (for dependency management)
65
60
- Docker (for running the Restack services)
66
-
- Local LLM provider (we use LMStudio and a Meta Llama 3.1 8B Instruct 4bit model in this example)
67
-
68
-
## Start LM stduio for local LLM provider
69
-
70
-
Start local server with Meta Llama 3.1 8B Instruct 4bit model
0 commit comments