Added perplexity and update the welcome page
This commit is contained in:
parent
85e3fc2ec0
commit
238dc88078
@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/edgedb/edgedb-go"
|
"github.com/edgedb/edgedb-go"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
@ -178,6 +179,13 @@ func RequestPerplexity(c *fiber.Ctx, model string, messages []Message, temperatu
|
|||||||
|
|
||||||
var inputCost float32 = float32(chatCompletionResponse.Usage.PromptTokens) * usedModelInfo.InputPrice
|
var inputCost float32 = float32(chatCompletionResponse.Usage.PromptTokens) * usedModelInfo.InputPrice
|
||||||
var outputCost float32 = float32(chatCompletionResponse.Usage.CompletionTokens) * usedModelInfo.OutputPrice
|
var outputCost float32 = float32(chatCompletionResponse.Usage.CompletionTokens) * usedModelInfo.OutputPrice
|
||||||
|
|
||||||
|
// If online model end with -online add a small cost
|
||||||
|
if strings.HasSuffix(model, "-online") {
|
||||||
|
inputCost += 0.005
|
||||||
|
outputCost += 0.005
|
||||||
|
}
|
||||||
|
|
||||||
addUsage(c, inputCost, outputCost, chatCompletionResponse.Usage.PromptTokens, chatCompletionResponse.Usage.CompletionTokens, model)
|
addUsage(c, inputCost, outputCost, chatCompletionResponse.Usage.PromptTokens, chatCompletionResponse.Usage.CompletionTokens, model)
|
||||||
|
|
||||||
return chatCompletionResponse, nil
|
return chatCompletionResponse, nil
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 59 KiB |
@ -43,6 +43,9 @@
|
|||||||
|
|
||||||
// Every 0.01s check if the text area have htmx-request class, if yes, add the class is-loading
|
// Every 0.01s check if the text area have htmx-request class, if yes, add the class is-loading
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
|
if (textareaControl === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (textareaControl.classList.contains('htmx-request')) {
|
if (textareaControl.classList.contains('htmx-request')) {
|
||||||
textareaControl.classList.add('is-loading');
|
textareaControl.classList.add('is-loading');
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<h1>JADE: The First Multi-Model Chatbot</h1>
|
<h1 class="title is-1">JADE: The First Multi-Model Chatbot</h1>
|
||||||
<p>The world of Large Language Models (LLMs) is vast and exciting, with each model boasting unique strengths and
|
<br><br>
|
||||||
|
<p>The world of Large Language Models (LLMs) is vast and exciting, with each model having unique strengths and
|
||||||
weaknesses. However, this variety presents a challenge: using all available LLMs is practically impossible due to
|
weaknesses. However, this variety presents a challenge: using all available LLMs is practically impossible due to
|
||||||
cost and complexity. Wouldn't it be incredible to have an easy way to experiment with different models, compare
|
cost and complexity. Wouldn't it be incredible to have an easy way to experiment with different models, compare
|
||||||
their responses, and even choose the best model for a specific task?</p>
|
their responses, and even choose the best model for a specific task?</p>
|
||||||
|
|
||||||
<p>This is precisely why JADE was built. With a focus on simplicity, JADE eliminates unnecessary features like file or
|
<p>This is precisely why JADE was built. With a focus on simplicity, JADE eliminates unnecessary features like file or
|
||||||
image uploads, allowing you to seamlessly interact with a variety of LLMs. This streamlined approach unlocks the
|
image uploads, allowing you to interact with a variety of LLMs. This streamlined approach unlocks the
|
||||||
potential to compare models, leverage their individual strengths, and even mitigate biases through multi-message
|
potential to compare models, leverage their individual strengths, and even mitigate biases through multi-message
|
||||||
conversations.</p>
|
conversations.</p>
|
||||||
|
|
||||||
@ -18,7 +19,7 @@
|
|||||||
<li>The selected response can be used as the basis for the next message across all models.</li>
|
<li>The selected response can be used as the basis for the next message across all models.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>For example, a response from GPT-4 can be used by Claude Haiku in the next interaction</p>
|
<p>For example, a response from GPT-4 Omni can be used by Claude Haiku in the next interaction.</p>
|
||||||
|
|
||||||
<p>This approach offers several benefits. First, it ensures you always have access to the best possible response by
|
<p>This approach offers several benefits. First, it ensures you always have access to the best possible response by
|
||||||
leveraging the strengths of different models. Second, it provides a more comprehensive understanding of a topic by
|
leveraging the strengths of different models. Second, it provides a more comprehensive understanding of a topic by
|
||||||
@ -77,10 +78,200 @@
|
|||||||
<i class="fa-solid fa-info"></i>
|
<i class="fa-solid fa-info"></i>
|
||||||
</span>
|
</span>
|
||||||
</button></h3>
|
</button></h3>
|
||||||
<p id="flexible-pricing-details" style="display:none;">JADE offers a flexible pricing model that allows you to
|
<p id="flexible-pricing-details" style="display:none;">JADE use API, so you get access to free credits or tiers
|
||||||
pay only for the tokens you use. This is particularly beneficial for users who may not need to use the
|
depending of the provider (see next section). This is particularly beneficial for users who may not need to
|
||||||
chatbot extensively. JADE starts with a free tier that allows you to send up to 200 messages a month. For
|
use the chatbot extensively. Once the free credit use, you pay based on the length of you message and the
|
||||||
more intensive use, you can upgrade for just $0.95/month.<br><br></p>
|
response generated in tokens (a token is around 3 characters). <br><br>JADE starts with a
|
||||||
|
free tier that allows you to send up to 200 messages a month. For more intensive use, you can upgrade for
|
||||||
|
just $0.95/month. So you can use Llama 70b for free forever if using JADE with a Groq Cloud account for
|
||||||
|
example.<br><br></p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<h3>All providers.<button class="button ml-2 is-small is-primary is-outlined"
|
||||||
|
onclick="toggleDetails('provider-details')">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<i class="fa-solid fa-info"></i>
|
||||||
|
</span>
|
||||||
|
</button></h3>
|
||||||
|
<div id="provider-details" style="display:none; overflow-x: hidden;">
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Providers available:</strong>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<strong>Models available:</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>OpenAI</strong> - OpenAI offer 5$ credits when creating an API account.
|
||||||
|
Around 10 000 small question to GPT-4 Omni or 100 000 to GPT-3.5 Turbo.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>GPT 4 Omni</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>GPT 4 Turbo</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>GPT 4</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>GPT 3.5 Turbo</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Anthropic</strong> - Anthropic offer 5$ credits when creating an API
|
||||||
|
account. Around 2 000 small question to claude-3-haiku-20240307 or 120 000 to Claude Haiku.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Claude 3 Opus</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Claude 3 Sonnet</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Claude 3 Haiku</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Mistral</strong> - Mistral do not offer free credits.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Mixtral 8x22b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mixtral 8x7b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mistral 7b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mistral Large</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mistral Small</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Codestral</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Groq</strong> - Groq offer a free tier with limit of tokens and request per minutes.
|
||||||
|
The rate is plenty for a chatbot. 30 messages and between 6 000 and 30 000 tokens per
|
||||||
|
minute. Per tokens coming soon.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Llama 3 70b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Llama 3 8b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mixtral 8x7b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Gemma 7b</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Google</strong> - Like Groq, Google offer a free tier with limit of tokens and
|
||||||
|
request per minutes. The rate is plenty for a chatbot. 15 messages and between 1 000 000
|
||||||
|
tokens per minute. Per tokens also available.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Gemini 1.5 pro</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Gemini 1.5 flash</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Gemini 1.0 pro</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column is-two-thirds">
|
||||||
|
<strong>Perplexity</strong> - Perplexity do not offer a free tier or credits. Perplexity
|
||||||
|
offer what they call 'online' models that can search online. So you can ask for the current
|
||||||
|
weather for example. Those models have additional cost of 5$ per 1 000 requests.
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Sonar Large</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Sonar Large Online</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Sonar Small</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Sonar Small Online</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Llama 70b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Llama 7b</strong>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Mixtral 8x7b</strong>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<strong>Hugging face</strong> - You can also use custom endpoints. I only tested hugging face but in
|
||||||
|
theory, as long as the key is valid and it use the openai api, it should work. This part need some
|
||||||
|
testing and improvement.
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user