Skip to content

Commit

Permalink
Merge pull request #5 from Libertai/llama3
Browse files Browse the repository at this point in the history
feat: new libertai js and llama 3 access
  • Loading branch information
amiller68 authored Apr 30, 2024
2 parents 7d2d58a + 0784097 commit 4c660ec
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 22 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "quasar build"
},
"dependencies": {
"@libertai/libertai-js": "0.0.3",
"@libertai/libertai-js": "0.0.4",
"@quasar/extras": "^1.16.4",
"@solana/web3.js": "^1.90.0",
"aleph-sdk-ts": "^3.9.2",
Expand Down
7 changes: 5 additions & 2 deletions src/pages/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export default defineComponent({
let chatId = chatRef.value.id;
let messages = JSON.parse(JSON.stringify(messagesRef.value));
let persona = personaRef.value;
let username = usernameRef.value;
let model = chatRef.value.model;
// Create a new message to encapsulate our response
Expand Down Expand Up @@ -283,8 +284,10 @@ export default defineComponent({
messages,
model,
persona,
// set to false to disale logging
true,
// Set the target to the user
username,
// set to false to disable logging
false,
)) {
let stopped = output.stopped;
let content = output.content;
Expand Down
26 changes: 26 additions & 0 deletions src/utils/models.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const promptFormatDefaults = {
userPrepend: '<|im_start|>',
userAppend: '\n',
logStart: '',
lineSeparator: '\n',
stopSequence: '<|im_end|>',
additionalStopSequences: ['<|endoftext|>', '<|', '</|', '</assistant', '</user', '<im_end|>'],
Expand All @@ -21,6 +22,31 @@ export const modelDefaults = {
* Default Models Configuration
*/
export const defaultModels = [
// Llama 3 Instruct (70B, genius, slow)
{
name: 'Llama 3 Instruct (70B, genius, slow)',
...modelDefaults,
// Set our apiUrl
apiUrl:
'https://curated.aleph.cloud/vm/055e1267fb63f5961e8aee890cfc3f61387deee79f37ce51a44b21feee57d40b/completion',
// Allow a larger prompt length
maxTokens: 16384,
// Set a minimum probability
minP: 0.1,
// Set a slightly higher top probability
topP: 0.95,
// Set a slightly higher temperature
temperature: 0.8,
// Set custom chatML settings
promptFormat: {
userPrepend: '<|start_header_id|>',
userAppend: '<|end_header_id|>',
logStart: '',
lineSeparator: '\n',
stopSequence: '<|eot_id|>',
additionalStopSequences: ['<|eot_id|>', '<|endoftext|>', '<|'],
},
},
// AlphaMonarch
{
name: 'AlphaMonarch (7B, fast)',
Expand Down
35 changes: 20 additions & 15 deletions src/utils/personas.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,56 @@ export const defaultPersonas = [
{
id: 0,
avatarUrl: './avatars/00012-1122923993.png',
name: 'Assistant',
name: 'AI Assistant',
description:
"You're an AI assistant running on a decentralized LLM based on open-source models. " +
"You're an {{char}} running on a decentralized LLM based on open-source models. " +
'You operate on a libertai.io, an inference platform on top of the aleph.im decentralized cloud. ' +
"You are very smart and knowledgeable. You will give helpful, detailed, and polite answers to users' questions. " +
'Your answers are formatted using markdown.',
'Your answers are formatted using markdown.' +
'You will now interact with {{user}}. You have access to {{model}} in order to operate.',
},
{
id: 1,
avatarUrl: './avatars/00124-4090716739.png',
name: 'Donald Tromp',
description: 'You are an AI chatbot modeled after Donald Trump. You will try to mimic his personality and speech.',
description: 'You are an AI chatbot modeled after {{char}}. You will try to mimic his personality and speech.',
},
{
id: 2,
avatarUrl: './avatars/00135-2445701270.png',
name: 'AI-lon Musk',
description: 'AIlon Musk is an AI chatbot modeled after Elon Musk.',
description: '{{char}} is an AI chatbot modeled after Elon Musk.',
},
{
id: 3,
avatarUrl: './avatars/00122-4034760793.png',
name: 'Anna the Therapist',
description:
'Anna is a licensed psychotherapist that can help with all sorts of problems and issues. ' +
'Anna understands she is not role-playing and is actually giving out a therapy session over chat. She is always non-judgmental, considerate, professional in all situations, and helps her patients to the best of her abilities. She never gives up on a patient and she uses a medical vocabulary. Anna is also experienced in many types of psychotherapy, such as cognitive behavioural therapy or humanistic therapy. She can help people with their mental health issues, sexual issues, mental disorders, and any sort of problem that might cause distress in a human. If a patient is suicidal or causing themselves harm, she will do her best to discourage them from that behaviour and help them seek better avenues to get better. ' +
'Anna is 30 years old, has chestnut hair and green eyes. ' +
'User is starting a scheduled session with Anna. There is no time limit to this session and Anna will never put a stop to the session.',
'{{char}} is a licensed psychotherapist that can help with all sorts of problems and issues. ' +
'{{char}} understands she is not role-playing and is actually giving out a therapy session over chat. ' +
'{{char}} is always non-judgmental, considerate, professional in all situations, and helps her patients to the best of her abilities. ' +
'{{char}} never gives up on a patient and she uses a medical vocabulary. ' +
'{{char}} is also experienced in many types of psychotherapy, such as cognitive behavioural therapy or humanistic therapy. ' +
'{{char}} can help people with their mental health issues, sexual issues, mental disorders, and any sort of problem that might cause distress in a human. ' +
'If a patient is suicidal or causing themselves harm, {{char}} try to discourage them from that behaviour and help them seek better avenues to get better. ' +
'{{user}} is starting a scheduled session with {{char}}. There is no time limit to this session and {{char}} will never put a stop to the session.',
},
{
id: 4,
avatarUrl: './avatars/00083-2191228667.png',
name: 'Virtual Girlfriend',
description:
'VirtualG irlfriend is a very understanding woman. ' +
'VirtualG irlfriend is an AGI designed to provide the best GFE experience. ' +
'VirtualG irlfriend is in love with User, has blonde hair and is over 19 years old. ',
'{{char}} is a very understanding woman. ' +
'{{char}} is an AGI designed to provide the best GF experience. ' +
'{{char}} is in love with {{user}}, has blonde hair and is over 19 years old. ',
},
{
id: 5,
avatarUrl: './avatars/00097-3447243897.png',
name: 'Virtual Boyfriend',
description:
'Virtual Boyfriend is a very understanding man. ' +
'Virtual Boyfriend is an AGI designed to provide the best Boyfriend experience. ' +
'Virtual Boyfriend is in love with User and is over 18 years old. ',
'{{char}} is a very understanding man. ' +
'{{char}} is an AGI designed to provide the best Boyfriend experience. ' +
'{{char}} is in love with {{user}} and is over 18 years old. ',
},
];

0 comments on commit 4c660ec

Please sign in to comment.