Collections of all the frequently asked questions
Does Embedchain support OpenAI's Assistant APIs?
Yes, it does. Please refer to the OpenAI Assistant docs page.
How to use MistralAI language model?
Use the model provided on huggingface: mistralai/Mistral-7B-v0.1
import os
from embedchain import App
os.environ["HUGGINGFACE_ACCESS_TOKEN"] = "hf_your_token"
app = App.from_config("huggingface.yaml")
How to use ChatGPT 4 turbo model released on OpenAI DevDay?
Use the model gpt-4-turbo
provided my openai.
import os
from embedchain import App
os.environ['OPENAI_API_KEY'] = 'xxx'
# load llm configuration from gpt4_turbo.yaml file
app = App.from_config(config_path="gpt4_turbo.yaml")
How to use GPT-4 as the LLM model?
import os
from embedchain import App
os.environ['OPENAI_API_KEY'] = 'xxx'
# load llm configuration from gpt4.yaml file
app = App.from_config(config_path="gpt4.yaml")
I don't have OpenAI credits. How can I use some open source model?
from embedchain import App
# load llm configuration from opensource.yaml file
app = App.from_config(config_path="opensource.yaml")
How to stream response while using OpenAI model in Embedchain?
You can achieve this by setting stream
to true
in the config file.
llm:
provider: openai
config:
model: 'gpt-4o-mini'
temperature: 0.5
max_tokens: 1000
top_p: 1
stream: true
How to persist data across multiple app sessions?
Set up the app by adding an id
in the config file. This keeps the data for future use. You can include this id
in the yaml config or input it directly in config
dict.
import os
from embedchain import App
os.environ['OPENAI_API_KEY'] = 'sk-xxx'
app1 = App.from_config(config={
"app": {
"config": {
"id": "your-app-id",
}
}
})
app1.add("https://www.forbes.com/profile/elon-musk")
response = app1.query("What is the net worth of Elon Musk?")
import os
from embedchain import App
os.environ['OPENAI_API_KEY'] = 'sk-xxx'
app2 = App.from_config(config={
"app": {
"config": {
# this will persist and load data from app1 session
"id": "your-app-id",
}
}
})
response = app2.query("What is the net worth of Elon Musk?")
If docs aren’t sufficient, please feel free to reach out to us using one of the following methods:
Was this page helpful?