I fully respect the work of the MistralAI team,
and I'm not saying that my API is better or anything.
It's just a complement with my ideas that I propose to add.
I'd like to introduce you "Mistral-X API", an API with new features compared to the official.
and with my personal touch ♥
➕ Features:
- Save Session History
- Token auth
- Response Streaming
- Fine-tuning ?
💡 Documentation:
See all endpoints here
See how to host the API here
See how to create your database here
And btw, this is my first API using FastAPI... :D
I recommend you to create a virtual environment first
python -m venv .venv
Launch your API in a few steps! :
1. Install dependencies
pip install -r requirements.txt
or, if you use Poetry:
poetry install
2. Create a .env
file
This file must contain :
# go to : https://console.mistral.ai/api-keys/
# and generate an API Key
MISTRAL_API_KEY = "<mistral-api-key>"
SECRET_KEY = "<secret-key>"
To generate a secret key:
- if you have openssl already installed:
openssl rand -hex 32
- else:
write random chars lmao
3. Finally, run uvicorn server
uvicorn main:app --reload
or, with Poetry:
poetry run uvicorn main:app --reload
MIT