Skip to content

Commit 975a511

Browse files
author
Kate Yanchenko
committed
Updated readme w/ Philosophy
1 parent 525d441 commit 975a511

11 files changed

+31
-249
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
12
# Lamoom
23

3-
## Introduction
4+
## Our Philosophy
5+
6+
Lamoom, derived from "Lambda on Mechanisms," refers to computation within a system that iteratively guides the LLM to perform correctly. Inspired by Amazon’s culture, as Jeff Bezos said, "Good intentions don't work, mechanisms do," we focus on building mechanisms for LLMs rather than relying on their good intentions
7+
8+
![Lamoom Mechanisms](docs/media/lamoom_mechanisms.gif)
49

10+
11+
## Introduction
512
Lamoom is a dynamic, all-in-one library designed for managing and optimizing prompts and making tests based on the ideal answer for large language models (LLMs) in production and R&D. It facilitates dynamic data integration, latency and cost metrics visibility, and efficient load distribution across multiple AI models.
613

14+
[![Lamoom Introduction Video](https://img.youtube.com/vi/1opO_5kRf98/0.jpg)](https://www.youtube.com/watch?v=1opO_5kRf98 "Lamoom Introduction Video")
15+
716
## Features
817

918
- **CI/CD testing**: Generates tests based on the context and ideal answer (usually written by the human).
1019
- **Dynamic Prompt Development**: Avoid budget exceptions with dynamic data.
1120
- **Multi-Model Support**: Seamlessly integrate with various LLMs like OpenAI, Anthropic, and more.
1221
- **Real-Time Insights**: Monitor interactions, request/response metrics in production.
13-
- **Prompt Testing and Evolution**: Quickly test and iterate on prompts using historical data.
22+
- **Prompt Testing and Evaluation**: Quickly test and iterate on prompts using historical data.
1423
- **Smart Prompt Caching**: Efficiently cache prompts for 5 minutes to reduce latency while keeping them updated.
1524
- **Asynchronous Logging**: Record interactions without blocking the main execution flow.
1625

@@ -20,7 +29,7 @@ Lamoom is a dynamic, all-in-one library designed for managing and optimizing pro
2029
Lamoom implements an efficient prompt caching system with a 5-minute TTL (Time-To-Live):
2130
- **Automatic Updates**: When you call a prompt, Lamoom checks if a newer version exists on the server.
2231
- **Cache Invalidation**: Prompts are automatically refreshed after 5 minutes to ensure up-to-date content.
23-
- **Local Fallback**: If the server is unavailable, Lamoom falls back to the locally defined prompt.
32+
- **Local Fallback**: If the LamoomService is unavailable, Lamoom library falls back to the locally defined prompt.
2433
- **Version Control**: Track prompt versions between local and server instances.
2534

2635
![Lamoom Call Flow](docs/sequence_diagrams/pngs/lamoom_call.png)
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
11
@startuml
22

33
title Lamoom Feedback Flow: Adding ideal answers to existing responses
4-
5-
note over Client,LamoomService: Process of providing feedback on previous responses
6-
7-
Client->>Lamoom: add_ideal_answer(response_id, ideal_answer)
8-
activate Lamoom
9-
10-
Lamoom->>LamoomService: update_response_ideal_answer(api_token, log_id, ideal_answer)
11-
activate LamoomService
12-
13-
LamoomService->>LamoomService: Prepare feedback data
14-
15-
LamoomService->>LamoomService: PUT /lib/logs
16-
note right of LamoomService: Server updates existing log with:\n- Ideal answer for comparison\n- Used for quality assessment\n- Creating training data\n- Generating automated tests
17-
4+
note over Lamoom,LamoomService: Process of providing feedback on previous responses
5+
Lamoom->>Lamoom: add_ideal_answer(response_id, ideal_answer)
6+
Lamoom->>LamoomService: update_response_ideal_answer(api_token, log_id, ideal_answer)
7+
note right of LamoomService: PUT /lib/logs: Server updates existing log with:\n- Ideal answer for comparison\n- Used for quality assessment\n- Creating training data\n- Generating automated tests
188
LamoomService-->>Lamoom: Return feedback submission result
19-
deactivate LamoomService
20-
21-
Lamoom-->>Client: Return feedback submission result
22-
deactivate Lamoom
23-
24-
@enduml
9+
@enduml
-7.51 KB
Loading
-6.58 KB
Loading
-7.45 KB
Loading
-19.9 KB
Loading

docs/sequence_diagrams/save_user_interactions.uml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,13 @@
55

66
note over Lamoom,LamoomService: Process of recording prompt execution logs
77

8-
Lamoom->>Lamoom: call(prompt_id, context, model)
9-
Lamoom->>LamoomService: Fetches prompt
10-
Lamoom->>LLM: calls LLM, gets response
8+
Lamoom->>Lamoom: call(prompt_id, context, model) - Fetches prompt, calls LLM, gets response
119
note right of SaveWorker: Async worker for saving\ninteractions to avoid blocking
1210

1311
Lamoom->>SaveWorker: add_task(api_token, prompt_data, context, result, test_data)
14-
12+
1513
SaveWorker->>LamoomService: save_user_interaction(api_token, prompt_data, context, response)
16-
17-
LamoomService->>LamoomService: POST /lib/logs
18-
note right of LamoomService: Server records interaction for:\n- Analytics\n- Debugging\n- Performance tracking\n- Cost monitoring
19-
20-
LamoomService-->>SaveWorker: Return result of logging operation
21-
14+
note right of LamoomService: POST /lib/logs: Server records interaction for:\n- Analytics\n- Debugging\n- Performance tracking\n- Cost monitoring
2215
Lamoom-->>Lamoom: Return AIResponse (without waiting for log completion)
2316

2417
@enduml

docs/sequence_diagrams/sequence_diagram_lamoom_call.uml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
@startuml
22

3-
Note over Lamoom,LibCache: Prompt Caching Flow (TTL: 5 minutes)
43
Note over Lamoom,LLM: Process of lamoom.call(prompt_id, context, model)
54

6-
Lamoom->>Lamoom: call(prompt_id, context, model)
75
Lamoom->>LibCache: get_prompt(prompt_id, version)
8-
9-
10-
alt Prompt is in cache or !API_SERVICE or RECEIVE_PROMPT_FROM_SERVER disabled
6+
alt Prompt is in cache or RECEIVE_PROMPT_FROM_SERVER disabled
117
Lamoom-->>LibCache: Return cached prompt data
128
end
139
alt Cache miss or expired or new version of prompt is in the code
14-
LamoomService->>LamoomService: POST /lib/prompts (with currently active prompt data)
10+
Lamoom->>LamoomService: POST /lib/prompts (with currently active prompt data)
1511

1612
Note right of LamoomService: Server checks if local prompt\nis the latest published version
1713

docs/sequence_diagrams/test_creation.uml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,20 @@
44

55
note over Lamoom,LamoomService: Process of creating tests for CI/CD validation
66

7-
alt Direct test creation via create_test method
8-
Client->>Lamoom: create_test(prompt_id, test_context, ideal_answer)
9-
10-
Lamoom->>LamoomService: POST /lib/tests?createTest
7+
alt Test creation via create_test method
8+
Lamoom->>LamoomService: create_test(prompt_id, test_context, ideal_answer)
119
note right of LamoomService: Server creates test with:\n- Prompt ID\n- Test context\n- Ideal answer
12-
10+
1311
LamoomService-->>Lamoom: Return create test result
14-
15-
Lamoom-->>Client: Return test creation result
1612
end
17-
18-
alt Test creation during normal prompt call with test_data
19-
Client->>Lamoom: call(prompt_id, context, model, test_data={ideal_answer})
2013

21-
Lamoom->>Lamoom: Fetches prompt, calls LLM, gets response
14+
alt Test creation during normal prompt call with test_data
15+
Lamoom->>Lamoom: call(prompt_id, context, model, test_data={ideal_answer}), Fetches prompt, calls LLM, gets response
2216

2317
Lamoom->>SaveWorker: add_task(api_token, prompt_data, context, result, test_data)
24-
SaveWorker->>LamoomService: create_test_with_ideal_answer(api_token, prompt_data, context, test_data)
25-
26-
note right of LamoomService: If ideal_answer exists in test_data
27-
28-
LamoomService->>LamoomService: POST /lib/tests
29-
note right of LamoomService: Server creates CI/CD test with:\n- Context\n- Prompt\n- Ideal answer\n- Behavior name
30-
31-
LamoomService-->>SaveWorker: Return (logs success message)
32-
33-
SaveWorker-->>Lamoom: (Async) Task complete
34-
Lamoom-->>Client: Return AIResponse (without waiting for test creation)
18+
SaveWorker->>LamoomService: create_test_with_ideal_answer
19+
note right of LamoomService: Server creates CI/CD test with:\n- Context\n- Prompt\n- Ideal answer
20+
Lamoom-->>Lamoom: Return AIResponse (without waiting for test creation)
3521
end
3622

37-
@enduml
23+
@enduml

examples/getting_started_notebook.ipynb

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)