|
4 | 4 |
|
5 | 5 | `quotientai` is an SDK and CLI built to manage your workflows on Quotient AI, the AI Evaluation Company. |
6 | 6 |
|
7 | | -## Installation |
8 | | - |
9 | | -**Prerequisites:** |
10 | | -- Python 3.10 or higher |
11 | | - |
12 | | -**Setup Guide:** |
13 | | -1. Receive the following from your contact at Quotient AI: |
14 | | - - account information (email, password) |
15 | | - - Github repo token |
16 | | - |
17 | | -2. Install `quotientai` client using pip: |
18 | | - ```bash |
19 | | - pip install git+https://{token}@github.com/quotient-ai/quotient-python.git |
20 | | - ``` |
21 | | - |
22 | | -## Using `quotientai` from the Command Line |
23 | | - |
24 | | - |
25 | | - |
26 | | -### Authentication |
27 | | -To use Quotient's platform, you'll need to create an API key: |
28 | | -```bash |
29 | | -quotient authenticate |
30 | | -``` |
31 | | - |
32 | | -Authenticate your requests by setting an environment variable for this API key: |
33 | | -```bash |
34 | | -export QUOTIENT_API_KEY=<api_key>; |
35 | | -``` |
36 | | - |
37 | | - |
38 | | -### Registering your account |
39 | | - |
40 | | -We are provisioning accounts until the open beta. |
41 | | - |
42 | | - |
43 | | - |
44 | | -### Viewing Resources |
45 | | -Explore available `models`, `datasets`, `prompt-templates`, `recipes`, `tasks`, and `jobs` using the CLI: |
46 | | -```bash |
47 | | -quotient list models |
48 | | - |
49 | | -+----+-----------------+-------------+------------------------------------------------+-------+ |
50 | | -| ID | Name | Model Type | Description | Owner | |
51 | | -+----+-----------------+-------------+------------------------------------------------+-------+ |
52 | | -| 1 | llama-2-7b-chat | HuggingFace | a llama-2 model fine-tuned on chat data | N/A | |
53 | | -| 2 | mpt-7b-chat | HuggingFace | a mpt model fine-tuned using the chatml format | N/A | |
54 | | -+----+-----------------+-------------+------------------------------------------------+-------+ |
55 | | -``` |
56 | | - |
57 | | -```bash |
58 | | -quotient list datasets |
59 | | - |
60 | | -+----+-------------------+---------------------------+-------------+-------+ |
61 | | -| ID | Name | File | File Format | Owner | |
62 | | -+----+-------------------+---------------------------+-------------+-------+ |
63 | | -| 1 | squad_v2 | N/A | N/A | N/A | |
64 | | -| 2 | summarize_dataset | llm_summarization.parquet | parquet | N/A | |
65 | | -+----+-------------------+---------------------------+-------------+-------+ |
66 | | -``` |
67 | | - |
68 | | -```bash |
69 | | -quotient list recipes |
70 | | - |
71 | | -+-----------+--------------------------+----------+-----------------+--------------------+-------------------------------------+ |
72 | | -| Recipe ID | Recipe Name | Model ID | Model Name | Prompt Template ID | Prompt Template Name | |
73 | | -+-----------+--------------------------+----------+-----------------+--------------------+-------------------------------------+ |
74 | | -| 1 | llama-question-answering | 1 | llama-2-7b-chat | 1 | Default Question Answering Template | |
75 | | -| 2 | llama-summarization | 1 | llama-2-7b-chat | 2 | Default Summarization Template | |
76 | | -| 3 | mpt-question-answering | 2 | mpt-7b-chat | 1 | Default Question Answering Template | |
77 | | -| 4 | mpt-summarization | 2 | mpt-7b-chat | 2 | Default Summarization Template | |
78 | | -+-----------+--------------------------+----------+-----------------+--------------------+-------------------------------------+ |
79 | | -``` |
80 | | - |
81 | | -### Submitting Jobs |
82 | | -Submit an evaluation job: |
83 | | -```bash |
84 | | -quotient create job --task-id 1 --recipe-id 1 --limit 50 |
85 | | - |
86 | | -+----+---------+-----------+-----------+--------------------------+-----------+-------+-------+ |
87 | | -| ID | Task ID | Task Name | Recipe ID | Recipe Name | Status | Limit | Owner | |
88 | | -+----+---------+-----------+-----------+--------------------------+-----------+-------+-------+ |
89 | | -| 75 | 1 | squad-v2 | 1 | llama-question-answering | Scheduled | 50 | 15 | |
90 | | -+----+---------+-----------+-----------+--------------------------+-----------+-------+-------+ |
91 | | - |
92 | | -``` |
93 | | -Monitor job status: |
94 | | -```bash |
95 | | -quotient list jobs --filter id 75 # replace with your job ID |
96 | | - |
97 | | -+----+---------+-----------+-----------+--------------------------+---------+-------+-------+ |
98 | | -| ID | Task ID | Task Name | Recipe ID | Recipe Name | Status | Limit | Owner | |
99 | | -+----+---------+-----------+-----------+--------------------------+---------+-------+-------+ |
100 | | -| 75 | 1 | squad-v2 | 1 | llama-question-answering | Running | 50 | 15 | |
101 | | -+----+---------+-----------+-----------+--------------------------+---------+-------+-------+ |
102 | | -``` |
103 | | - |
104 | | -### Retrieving Results |
105 | | -When a job has completed, you can view the results: |
106 | | - |
107 | | -```bash |
108 | | -quotient list results --job-id 75 |
109 | | -+----+-----------------+-----------+------------------+--------------------+-----------+------+ |
110 | | -| ID | Model Name | Task Name | Metrics | Task Type | # Samples | Seed | |
111 | | -+----+-----------------+-----------+------------------+--------------------+-----------+------+ |
112 | | -| 75 | llama-2-7b-chat | squad-v2 | f1_score_jaccard | question_answering | 46 | N/A | |
113 | | -+----+-----------------+-----------+------------------+--------------------+-----------+------+ |
114 | | -+------------------------------+------------------------------+------------------------------+----------------------+ |
115 | | -| Model Input | Model Output | Expected Answer | Metric Score | |
116 | | -+------------------------------+------------------------------+------------------------------+----------------------+ |
117 | | -| In what country is Norman... | Question: How much is the... | France | 0.0 | |
118 | | -| When were the Normans in ... | Your answers helped me un... | 10th and 11th centuries | 0.05555555555555556 | |
119 | | -| From which countries did ... | The answer is not very cl... | Denmark, Iceland and Norw... | 0.06818181818181818 | |
120 | | -| Who was the Norse leader? | Question: Who was the lea... | Rollo | 0.04545454545454545 | |
121 | | -| What century did the Norm... | The answer is not difficu... | the first half of the 10t... | 0.027027027027027025 | |
122 | | -| Who gave their name to No... | Your answers helped me un... | unanswerable | 0.0 | |
123 | | -| What is France a region o... | Question: What is France ... | unanswerable | 0.0 | |
124 | | -| Who did King Charles III ... | Your answers helped me un... | unanswerable | 0.0 | |
125 | | -| When did the Frankish ide... | Question: When did the En... | unanswerable | 0.0 | |
126 | | -| Who was the duke in the b... | Question: How much money ... | William the Conqueror | 0.016949152542372885 | |
127 | | -| What is the original mean... | I have a question about t... | Norseman, Viking | 0.022988505747126436 | |
128 | | -| When was the Latin versio... | I have a question about t... | 9th century | 0.0 | |
129 | | -| What name comes from the ... | I have a question about t... | unanswerable | 0.0 | |
130 | | -| When was the French versi... | I have a question about t... | unanswerable | 0.0 | |
131 | | -+------------------------------+------------------------------+------------------------------+----------------------+ |
132 | | -More results available. Use the SDK to view more results |
133 | | -``` |
134 | | - |
135 | | -**To dig into the results, we recommend you use the SDK to explore all the data.** |
136 | | - |
137 | | -## Using `quotientai` as a Python Package (SDK) |
138 | | - |
139 | | -### Getting Started with the Python Client |
140 | | -Import and initialize the QuotientClient with your credentials: |
141 | | - |
142 | | -```python |
143 | | -from quotientai.client import QuotientClient |
144 | | - |
145 | | -client = QuotientClient() |
146 | | -``` |
147 | | - |
148 | | - |
149 | | -### Retrieving All Models |
150 | | -Fetch all available models: |
151 | | -```python |
152 | | -models = client.list_models() |
153 | | -``` |
154 | | - |
155 | | -### Creating a new Job |
156 | | -```python |
157 | | -job_data = { |
158 | | - "task_id": 1, |
159 | | - "recipe_id": 1, |
160 | | - "num_fewshot_examples": 0, |
161 | | - "limit": 50, |
162 | | -} |
163 | | -job = client.create_job(job_data) |
164 | | -``` |
165 | | - |
166 | | -### Retrieving Jobs and Results |
167 | | -Get details about all jobs, or filter by specific criteria such as job ID: |
168 | | - |
169 | | -```python |
170 | | -jobs = client.list_jobs(filters={'id':job_id}) |
171 | | -``` |
172 | | - |
173 | | -To explore your results data: |
174 | | - |
175 | | -```python |
176 | | -results = client.get_eval_results(jobs[0]['id']) |
177 | | -for result in results['results']: |
178 | | - print("Model Input:", result["content"]["input_text"]) |
179 | | - print("Model Output:", result["content"]["completion"]) |
180 | | - print("Expected Answer:", result["content"]["answer"]) |
181 | | - print("\n") |
182 | | -``` |
| 7 | +We are currently in closed beta. For more information on how to get early access visit us at [QuotientAI.co](https://www.quotientai.co/) |
183 | 8 |
|
184 | 9 | ## Support |
185 | 10 | For assistance and inquiries: [[email protected]](mailto:[email protected]) |
0 commit comments