together-ai 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,11 +25,11 @@ const together = new Together({
25
25
  auth: process.env.TOGETHER_API_KEY,
26
26
  });
27
27
 
28
- const model = 'mistralai/Mistral-7B-Instruct-v0.1';
28
+ const model = 'mistralai/Mixtral-8x7B-Instruct-v0.1';
29
29
 
30
30
  const result = await together.inference(model, {
31
- prompt: 'Suggest some fun family activities for the new year',
32
- max_tokens: 300,
31
+ prompt: 'Suggest some fun winter family activities',
32
+ max_tokens: 700,
33
33
  });
34
34
  ```
35
35
 
@@ -45,16 +45,29 @@ const result = await together.inference('togethercomputer/llama-2-70b-chat', {
45
45
  });
46
46
  ```
47
47
 
48
- ### Example Chat App
48
+ ### Next.js Chat App with streaming
49
49
 
50
- You can see an example of this library being used in a chat app here: https://simple-ai-chat.vercel.app.
50
+ You can see an example of this library being used in a Next.js chat app here: https://simple-ai-chat.vercel.app.
51
51
 
52
- The code for the example is also available. This includes code on how to stream the results of the LLM directly to the frontend: https://github.com/Nutlope/chat
52
+ The code for the example is also available, including code on how to stream the results of the LLM directly to the frontend: https://github.com/Nutlope/chat.
53
+
54
+ ### Filtering responses with Llama Guard
55
+
56
+ You can now use Llama Guard, an LLM-based input-output safeguard model, with models on the Together.ai platform. To do this, simply add `"safety_model": "Meta-Llama/Llama-Guard-7b"`.
57
+
58
+ ```js
59
+ const result = await together.inference('togethercomputer/llama-2-13b-chat', {
60
+ prompt: 'Tell me about San Francisco',
61
+ max_tokens: 1000,
62
+ safety_model: 'Meta-Llama/Llama-Guard-7b',
63
+ });
64
+ ```
53
65
 
54
66
  ## Popular Supported Models
55
67
 
56
- This is a list of popular models that are supported.
68
+ This is a non-exhaustive list of popular models that are supported.
57
69
 
70
+ - Mixtral Instruct v0.1 (`mistralai/Mixtral-8x7B-Instruct-v0.1`)
58
71
  - Mistral-7B (`mistralai/Mistral-7B-Instruct-v0.1`)
59
72
  - Llama-2 70B (`togethercomputer/llama-2-70b-chat`)
60
73
  - Llama-2 13B (`togethercomputer/llama-2-13b-chat`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "together-ai",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Node.js SDK for Together.ai.",
5
5
  "author": "Hassan El Mghari (@nutlope)",
6
6
  "repository": "Nutlope/together-js",