QuickStart: Friendli Serverless Endpoints
1. Log In or Sign Up
- If you have an account, log in using your preferred SSO or email/password combination.
- If you're new to FriendliAI, create an account for free.
2. Access Friendli Serverless Endpoints
- On your dashboard, find the "Friendli Serverless Endpoints" section.
- Click the "Go to Playground" button to start generating text or images.
3. Select a Model
- Browse the available generative models, including options for text generation, image creation, and more.
- Choose the model that best aligns with your desired use case.
- First-time users receives a $5 free trial to explore Friendli Serverless Endpoints without any financial commitment.
4. Generate Responses
- Enter Your Query:
- Type in your prompt or question.
- Alternatively, select from the provided example queries to try out different scenarios.
- Adjust Settings:
- Refer to the Text Generation and Image Generation docs for more details on the settings applicable for each of the text or image generation models.
- Generate Your Response:
- Click the "Generate" button to start the generation process.
- The model will process your query and produce the corresponding text or image output. That's it!
info
Generating Responses Through the Endpoint URL
If you wish to send your requests through the endpoint URL, you can find the endpoint URL by hitting the 'More Info` button on the top-right corner of the page. Refer to this guide for general instructions on the personal access tokens.
You can send your request through cURL or with the requests
python library:
- Bash (Text)
- Bash (Image)
- Python
# Inference request to a running Friendli Serverless Endpoint using a `curl` command.
$ curl -X POST $SERVERLESS_ENDPOINT_URL \
-H "Authorization: Bearer $PERSONAL_ACCESS_TOKEN" \
-d '{"prompt": "Python is a popular", "min_tokens": 20, "max_tokens": 30,
"top_k": 32, "top_p": 0.8, "n": 3, "no_repeat_ngram": 3,
"ngram_repetition_penalty": 1.75}'
# Inference request to a running Friendli Serverless Endpoint using a `curl` command.
$ curl -X POST $SERVERLESS_ENDPOINT_URL \
-H "Authorization: Bearer $FRIENDLI_API_KEY" \
-F "prompt=$PROMPT" -F "num_inference_steps=25"
# Inference request to a Friendli Serverless Endpoint using Python requests.
import requests
import json
output = requests.post(
url=url,
headers=headers,
json={
"prompt": "Python is a popular",
"min_tokens": 20,
"max_tokens": 30,
"top_k": 32,
"top_p": 0.8,
"n": 3,
"no_repeat_ngram": 3,
"ngram_repetition_penalty": 1.75,
},
)
print(output.json())
Additional Tips:
Check out the Text Generation and Image Generation docs for more details.