Skip to content

Commit 0404a83

Browse files
pjoshi30Preetam Joshi
andauthored
Updating README and renaming to aimon-python-sdk (#35)
Co-authored-by: Preetam Joshi <info@aimon.ai>
1 parent f70e452 commit 0404a83

8 files changed

+159
-127
lines changed

README.md

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# 🎉**Welcome to AIMon Rely**
1+
# 🎉**Welcome to AIMon**
22

3-
AIMon Rely helps developers build, ship, and monitor LLM Apps more confidently and reliably with its state-of-the-art, multi-model system for detecting LLM quality issues. It helps seamlessly with both offline evaluations and continuous production monitoring. AIMon Rely offers fast, reliable, and cost-effective hallucination detection. It also supports other important quality metrics such as completeness, conciseness, and toxicity. Read our [blog post](https://aimon.ai/blogs/introducing-rely) for more details.
3+
AIMon helps developers build, ship, and monitor LLM Apps more confidently and reliably with its state-of-the-art, multi-model system for detecting LLM quality issues. It helps seamlessly with both offline evaluations and continuous production monitoring. AIMon offers fast, reliable, and cost-effective hallucination detection. It also supports other important quality metrics such as completeness, conciseness, and toxicity. Read our [blog post](https://aimon.ai/blogs/introducing-rely) for more details.
44

55
**Join our community on [Slack](https://join.slack.com/t/generativeair/shared_invite/zt-2jab62lsj-xM9a_s~Qweu8lf3YS2cANg)**
66

77
<div align="center">
8-
<img src="images/aimon-rely-image.png" alt="AIMon Rely" width="450" height="350">
8+
<img src="images/aimon-rely-image.png" alt="AIMon" width="650" height="350">
99
</div>
1010

1111
## Metrics Supported
@@ -19,10 +19,6 @@ The following is a list of quality metrics that are currently available and on o
1919
| Conciseness | <span style="font-size: 24px; color: green;">&#10003;</span> |
2020
| Toxicity | <span style="font-size: 24px; color: green;">&#10003;</span> |
2121
| Instruction Adherence | <span style="font-size: 24px; color: green;">&#10003;</span> |
22-
| Semantic Similarity | <span style="font-size: 24px;">⌛</span> |
23-
| Sentiment | <span style="font-size: 24px;">⌛</span> |
24-
| Coherence | <span style="font-size: 24px;">⌛</span> |
25-
| Sensitive Data (PII/PHI/PCI) | <span style="font-size: 24px;">⌛</span> |
2622

2723
## Getting Started
2824

@@ -36,23 +32,22 @@ to get started with using the AIMon SDK and the product.
3632
- Step 1: Get access to the beta product by joining the waitlist on our [website](https://aimon.ai/) or by requesting
3733
it on [Slack](https://join.slack.com/t/generativeair/shared_invite/zt-2jab62lsj-xM9a_s~Qweu8lf3YS2cANg) or sending an email to info@aimon.ai
3834
- Step 2: Install the AIMon SDK by running `pip install aimon` in your terminal.
39-
- Step 3: For an axample of quick start usage
35+
- Step 3: Here is an example to instrument an LLM application **synchronously** using the AIMon decorator:
4036

4137
```python
42-
from aimon import Client
43-
44-
API_KEY = "YOUR_API_KEY"
45-
client = Client(auth_header=f"Bearer {API_KEY}")
46-
data_to_send = [{
47-
"context": "This is the context",
48-
"generated_text": "This is the context",
49-
"config": {'hallucination': {'detector_name': 'default'}}
50-
}]
51-
response = client.inference.detect(body=data_to_send)[0]
38+
from aimon import Detect
39+
40+
detect = Detect(values_returned=['context', 'generated_text'], config={"hallucination": {"detector_name": "default"}})
41+
42+
@detect
43+
def my_llm_app(context, query):
44+
# my_llm_model is the function that generates text using the LLM model
45+
generated_text = my_llm_model(context, query)
46+
return context, generated_text
5247
```
5348

54-
- Step 4: For an example of how to instrument an LLM application **asynchronously** using the SDK, please refer to the [sample notebook](examples/notebooks/aimon_sdk_langchain_summarization_0_5_0.ipynb)
55-
- Step 5: For an example of synchronous detections using the SDK, please refer to the sample [streamlit application](examples/langchain_summarization_app.py)
49+
- Step 4: For an example of how to instrument an LLM application **asynchronously** using the SDK, please refer `analyze_prod` decorator.
50+
- Step 5: For an example of synchronous detections using the SDK, please refer to the sample [streamlit application](examples/streamlit_apps/summarization/langchain_summarization_app.py)
5651

5752
<div align="center">
5853
<img src="images/product_apps_page.png" alt="AIMon Product">
@@ -66,10 +61,6 @@ AIMon detections can be accessed via REST APIs. Here are the steps to access the
6661
to info@aimon.ai
6762
- Step 2: Download the [Postman Collection](examples/postman_collections) specified below to access the API
6863

69-
### Sandbox
70-
71-
You can try our [Sandbox](https://aimon.ai/tryproduct) that is available on our website to try our Hallucination detection models quickly.
72-
7364
## Benchmarks
7465

7566
### Hallucination Detection
@@ -79,15 +70,15 @@ hallucination detection task. The table below shows our results.
7970

8071
A few key takeaways:
8172

82-
✅ AIMon Rely is **10x cheaper** than GPT-4 Turbo.
73+
✅ AIMon is **10x cheaper** than GPT-4 Turbo.
8374

84-
✅ AIMon Rely is **4x faster** than GPT-4 Turbo.
75+
✅ AIMon is **4x faster** than GPT-4 Turbo.
8576

86-
✅ AIMon Rely provides the convenience of a fully hosted API that includes baked-in explainability.
77+
✅ AIMon provides the convenience of a fully hosted API that includes baked-in explainability.
8778

8879
✅ Support for a context length of up to 32,000 tokens (with plans to further expand this in the near future).
8980

90-
Overall, AIMon Rely is 10 times cheaper, 4 times faster, and close to or even **better than GPT-4** on the benchmarks
81+
Overall, AIMon is 10 times cheaper, 4 times faster, and close to or even **better than GPT-4** on the benchmarks
9182
making it a suitable choice for both offline and online detection of hallucinations.
9283

9384
<div align="center">
@@ -101,12 +92,8 @@ Stay Tuned! <span style="font-size: 16px;">⌛</span>
10192

10293
## Pricing
10394

104-
Please reach out to info@aimon.ai for pricing details related to the product and the API.
105-
106-
## Future Work
95+
Refer to the website [aimon.ai](https://aimon.ai) for details.
10796

108-
- We are working on additional metrics as detailed in the table above.
109-
- In addition, we are working on something awesome to make the offline evaluation and continuous model quality
110-
monitoring experience more seamless.
97+
## Community
11198

112-
Join our [Slack](https://join.slack.com/t/generativeair/shared_invite/zt-2jab62lsj-xM9a_s~Qweu8lf3YS2cANg) for the latest updates and discussions on generative AI reliability.
99+
Join our [Slack community](https://join.slack.com/t/generativeair/shared_invite/zt-2jab62lsj-xM9a_s~Qweu8lf3YS2cANg) for the latest updates and discussions on generative AI reliability.

README_PyPi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# 🎉**Welcome to AIMon Rely**
1+
# 🎉**Welcome to AIMon**
22

3-
AIMon Rely helps developers build, ship, and monitor LLM Apps more confidently and reliably with its state-of-the-art, multi-model system for detecting LLM quality issues. It helps seamlessly with both offline evaluations and continuous production monitoring. AIMon Rely offers fast, reliable, and cost-effective hallucination detection. It also supports other important quality metrics such as completeness, conciseness, and toxicity. Read our [blog post](https://aimon.ai/blogs/introducing-rely) for more details.
3+
AIMon helps developers build, ship, and monitor LLM Apps more confidently and reliably with its state-of-the-art, multi-model system for detecting LLM quality issues. It helps seamlessly with both offline evaluations and continuous production monitoring. AIMon offers fast, reliable, and cost-effective hallucination detection. It also supports other important quality metrics such as completeness, conciseness, and toxicity. Read our [blog post](https://aimon.ai/blogs/introducing-rely) for more details.

examples/notebooks/aimon_continuous_mon_decorators_langchain_summarization.ipynb

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,9 @@
55
"execution_count": 1,
66
"id": "d8495fd8-cd0a-406f-8f20-f6b66fd585fe",
77
"metadata": {},
8-
"outputs": [
9-
{
10-
"name": "stdout",
11-
"output_type": "stream",
12-
"text": [
13-
"\u001b[33mWARNING: You are using pip version 20.2.3; however, version 24.2 is available.\n",
14-
"You should consider upgrading via the '/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/bin/python3 -m pip install --upgrade pip' command.\u001b[0m\n"
15-
]
16-
}
17-
],
8+
"outputs": [],
189
"source": [
19-
"!pip install langchain langchain-community --quiet"
10+
"!pip install langchain langchain-community openai tiktoken --quiet"
2011
]
2112
},
2213
{
@@ -42,7 +33,7 @@
4233
},
4334
{
4435
"cell_type": "code",
45-
"execution_count": 4,
36+
"execution_count": 5,
4637
"id": "a7cf7522-c09c-4c4a-b714-f57527de6974",
4738
"metadata": {},
4839
"outputs": [],
@@ -57,14 +48,14 @@
5748
},
5849
{
5950
"cell_type": "code",
60-
"execution_count": 5,
51+
"execution_count": 6,
6152
"id": "d5c3e5f0-7611-4e44-ba32-b721fba56218",
6253
"metadata": {},
6354
"outputs": [],
6455
"source": [
6556
"analyze_prod = AnalyzeProd(\n",
6657
" Application(\"llm_marketing_summarization_app_v2\"), \n",
67-
" Model(\"my_gpt4_model_fine_tuned\", \"GPT-4\"), \n",
58+
" Model(\"my_gpt40_model\", \"GPT-4\"), \n",
6859
" values_returned=[\"context\", \"generated_text\", \"instructions\"],\n",
6960
" api_key=os.getenv(\"AIMON_API_KEY\"),\n",
7061
" config=aimon_config\n",
@@ -83,7 +74,7 @@
8374
},
8475
{
8576
"cell_type": "code",
86-
"execution_count": 6,
77+
"execution_count": 7,
8778
"id": "44438e7f-5652-46b5-9244-cbf2977d9d48",
8879
"metadata": {},
8980
"outputs": [],
@@ -111,7 +102,7 @@
111102
},
112103
{
113104
"cell_type": "code",
114-
"execution_count": 7,
105+
"execution_count": 8,
115106
"id": "bb81a8ad-e10a-43f5-9682-844d9ab2ccb4",
116107
"metadata": {},
117108
"outputs": [],
@@ -143,18 +134,18 @@
143134
},
144135
{
145136
"cell_type": "code",
146-
"execution_count": 8,
137+
"execution_count": 9,
147138
"id": "1e0dc9d7-e0b0-4a05-8967-0e06179486a3",
148139
"metadata": {},
149140
"outputs": [
150141
{
151142
"name": "stderr",
152143
"output_type": "stream",
153144
"text": [
154-
"/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/lib/python3.9/site-packages/langchain_core/_api/deprecation.py:139: LangChainDeprecationWarning: The class `OpenAI` was deprecated in LangChain 0.0.10 and will be removed in 0.3.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import OpenAI`.\n",
155-
" warn_deprecated(\n",
156-
"/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/lib/python3.9/site-packages/langchain_core/_api/deprecation.py:139: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 0.3.0. Use invoke instead.\n",
157-
" warn_deprecated(\n"
145+
"/var/folders/7l/300zf44j5v9c43jpqdbhkl0h0000gn/T/ipykernel_21281/2616907130.py:17: LangChainDeprecationWarning: The class `OpenAI` was deprecated in LangChain 0.0.10 and will be removed in 1.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import OpenAI`.\n",
146+
" llm = OpenAI(temperature=0, openai_api_key=openai_api_key)\n",
147+
"/var/folders/7l/300zf44j5v9c43jpqdbhkl0h0000gn/T/ipykernel_21281/2616907130.py:19: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 1.0. Use invoke instead.\n",
148+
" return context_docs, chain.run(docs), instructions\n"
158149
]
159150
}
160151
],
@@ -164,15 +155,15 @@
164155
},
165156
{
166157
"cell_type": "code",
167-
"execution_count": 9,
158+
"execution_count": 10,
168159
"id": "5515eafd-8644-4792-a69e-23625a026c6c",
169160
"metadata": {},
170161
"outputs": [
171162
{
172163
"name": "stdout",
173164
"output_type": "stream",
174165
"text": [
175-
"AnalyzeCreateResponse(message='Data successfully sent to AIMon.')\n"
166+
"AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)\n"
176167
]
177168
}
178169
],

examples/notebooks/aimon_evaluation_decorators_langchain_summarization.ipynb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,9 @@
55
"execution_count": 1,
66
"id": "d8495fd8-cd0a-406f-8f20-f6b66fd585fe",
77
"metadata": {},
8-
"outputs": [
9-
{
10-
"name": "stdout",
11-
"output_type": "stream",
12-
"text": [
13-
"\u001b[33mWARNING: You are using pip version 20.2.3; however, version 24.2 is available.\n",
14-
"You should consider upgrading via the '/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/bin/python3 -m pip install --upgrade pip' command.\u001b[0m\n"
15-
]
16-
}
17-
],
8+
"outputs": [],
189
"source": [
19-
"!pip install langchain langchain-community --quiet"
10+
"!pip install langchain langchain-community openai tiktoken --quiet"
2011
]
2112
},
2213
{
@@ -194,10 +185,10 @@
194185
"name": "stderr",
195186
"output_type": "stream",
196187
"text": [
197-
"/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/lib/python3.9/site-packages/langchain_core/_api/deprecation.py:139: LangChainDeprecationWarning: The class `OpenAI` was deprecated in LangChain 0.0.10 and will be removed in 0.3.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import OpenAI`.\n",
198-
" warn_deprecated(\n",
199-
"/Users/preetamjoshi/projects/aimon/pj_aimon_rely/examples/chatbot/chtbot/lib/python3.9/site-packages/langchain_core/_api/deprecation.py:139: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 0.3.0. Use invoke instead.\n",
200-
" warn_deprecated(\n"
188+
"/var/folders/7l/300zf44j5v9c43jpqdbhkl0h0000gn/T/ipykernel_21311/1548092027.py:24: LangChainDeprecationWarning: The class `OpenAI` was deprecated in LangChain 0.0.10 and will be removed in 1.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import OpenAI`.\n",
189+
" llm = OpenAI(temperature=0, openai_api_key=openai_api_key)\n",
190+
"/var/folders/7l/300zf44j5v9c43jpqdbhkl0h0000gn/T/ipykernel_21311/1548092027.py:26: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 1.0. Use invoke instead.\n",
191+
" return chain.run(docs)\n"
201192
]
202193
}
203194
],
@@ -215,7 +206,7 @@
215206
"name": "stdout",
216207
"output_type": "stream",
217208
"text": [
218-
"[(' Acme recently launched version 2.1 of their Python library, which has deep integrations with the Python ecosystem and has been proven to be valuable for developers. This new version includes features like async support and improved error handling.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), ('\\n\\nTo configure the Acme python client, follow the official documentation which includes setting up environment variables and installing dependencies for both basic and advanced setups.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), (' The Acme python client is compatible with Python 3.6+ and multiple databases, including MySQL, PostgreSQL, and MongoDB. It is also suitable for cross-language projects with Node.js.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), (' The Acme python client may have installation, package conflicts, and connectivity issues. Troubleshooting involves checking the Python environment, dependencies, and log files, with specific error resolutions available in the online help section.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), (' Acme recently launched version 2.1 of their Python library, which has deep integrations with the Python ecosystem and has been proven to be beneficial for developers. This new version includes features like async support and improved error handling.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), ('\\n\\nTo configure the Acme python client, follow the official documentation which includes setting up environment variables and installing dependencies for both basic and advanced setups.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), (' The Acme python client is compatible with Python 3.6+ and multiple databases, including MySQL, PostgreSQL, and MongoDB. It is also suitable for cross-language projects with Node.js.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.')), (' The Acme python client may have installation, package conflicts, and connectivity issues. Troubleshooting involves checking the Python environment, dependencies, and log files, with specific error resolutions available in the online help section.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.'))]\n"
209+
"[(' Acme recently launched version 2.1 of their Python library, which has deep integrations with the Python ecosystem and has been proven to be beneficial for developers. This new version includes features like async support and improved error handling.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), ('\\n\\nTo configure the Acme python client, follow the official documentation which includes setting up environment variables and installing dependencies for both basic and advanced setups.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), (' The Acme python client is compatible with Python 3.6+ and multiple databases, including MySQL, PostgreSQL, and MongoDB. It is also suitable for cross-language projects with Node.js.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), (' The Acme python client may have installation, package conflicts, and connectivity issues. Troubleshooting involves checking the Python environment, dependencies, and log files, with specific error resolutions available in the online help section.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), (' Acme recently launched version 2.1 of their Python library, which has deep integrations with the Python ecosystem and has been proven to be beneficial for developers. This new version includes features like async support and improved error handling.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), ('\\n\\nTo configure the Acme python client, environment variables must be set up and dependencies must be installed. Detailed instructions for both basic and advanced setups can be found in the official documentation.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), (' The Acme python client is compatible with Python 3.6+ and multiple databases, including MySQL, PostgreSQL, and MongoDB. It is also suitable for cross-language projects with Node.js.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200)), (' The Acme python client may have installation, package conflicts, and connectivity issues. Troubleshooting involves checking the Python environment, dependencies, and log files, with specific error resolutions available in the online help section.', AnalyzeCreateResponse(message='Data successfully sent to AIMon.', status=200))]\n"
219210
]
220211
}
221212
],

0 commit comments

Comments
 (0)