Eden API Documentation for Performing Inference

Base URL

The base URL for the Eden inference API is:

https://www.ai.eden42.com/api/v1/chat/completions

Authentication

To authenticate, include your API key in the header of each request:

Authorization: Bearer YOUR_API_KEY

Models

  • eden-8b: Lightweight model made by an advanced fine-tune of LLAMA-3 8B
  • eden-70b: Mid-range model made by an advanced fine-tune of LLAMA-3 70B
  • eden-120b: High-performance model made by an advanced fine-tune of GOLIATH 120B

Parameters

  • model (string): Model identifier. Options: eden-8b, eden-70b, eden-120b.
  • messages (array): The array of string messages in the chat you want to provide the model.
  • temperature (float): Controls the randomness of the output. Range: 0.0 to 1.0. Default: 0.7.
  • top_k (int): The number of highest probability vocabulary tokens to keep for top-k filtering. Default: 50.
  • top_p (float): The cumulative probability of parameter highest probability tokens to keep for nucleus sampling. Range: 0.0 to 1.0. Default: 0.9.
  • min_k (int): Minimum number of tokens before stopping generation. Default: 1.
  • top_a (float): Alpha for controlling the probability distribution. Default: 1.0.
  • stop_sequences (array of strings): A list of strings where the model will stop generating further tokens.
  • max_tokens (int): Maximum number of tokens to generate. Default: 50.

Request and Response

Example Request

Endpoint:

POST /v1/inference

Headers:

Content-Type: application/json Authorization: Bearer YOUR_API_KEY

Request Body:

{
              "model": "eden-8b",
              "messages": ["Message 1", "Message 2", "Message 3", "Message 4"],
              "temperature": 0.7,
              "top_k": 50,
              "top_p": 0.9,
              "min_k": 1,
              "top_a": 1.0,
              "stop_sequences": ["The end.", "They lived happily ever after."],
              "max_tokens": 50
            }

Example Response

Response Body:

{
              "model": "eden-8b",
              "messages": ["Message 1", "Message 2", "Message 3", "Message 4"],
              "completion": "Once upon a time, in a land far...the end.",
              "temperature": 0.7,
              "top_k": 50,
              "top_p": 0.9,
              "min_k": 1,
              "top_a": 1.0,
              "stop_sequences": ["The end.", "They lived happily ever after."],
              "max_tokens": 50
            }

API Call Models

Python Example

import requests

            url = "https://api.edenmodels.com/v1/inference"
            headers = {
                "Content-Type": "application/json",
                "Authorization": "Bearer YOUR_API_KEY"
            }
            data = {
                "model": "eden-8b",
                "messages": ["Message 1", "Message 2", "Message 3", "Message 4"],
                "temperature": 0.7,
                "top_k": 50,
                "top_p": 0.9,
                "min_k": 1,
                "top_a": 1.0,
                "stop_sequences": ["The end.", "They lived happily ever after."],
                "max_tokens": 50
            }

            response = requests.post(url, headers=headers, json=data)
            print(response.json())

Curl Example

curl -X POST https://api.edenmodels.com/v1/inference \
            -H "Content-Type: application/json" \
            -H "Authorization: Bearer YOUR_API_KEY" \
            -d '{
              "model": "eden-8b",
              "messages": ["Message 1", "Message 2", "Message 3", "Message 4"],
              "temperature": 0.7,
              "top_k": 50,
              "top_p": 0.9,
              "min_k": 1,
              "top_a": 1.0,
              "stop_sequences": ["The end.", "They lived happily ever after."],
              "max_tokens": 50
            }'

JavaScript Example (using fetch)

fetch("https://api.edenmodels.com/v1/inference", {
              method: "POST",
              headers: {
                "Content-Type": "application/json",
                "Authorization": "Bearer YOUR_API_KEY"
              },
              body: JSON.stringify({
                model: "eden-8b",
                messages: ["Message 1", "Message 2", "Message 3", "Message 4"],
                temperature: 0.7,
                top_k: 50,
                top_p: 0.9,
                min_k: 1,
                top_a: 1.0,
                stop_sequences: ["The end.", "They lived happily ever after."],
                max_tokens: 50
              })
            })
            .then(response => response.json())
            .then(data => console.log(data))
            .catch(error => console.error("Error:", error));

Error Handling

Example Error Response

If the request fails, the API will return an error response.

{
              "error": {
                "code": 400,
                "message": "Invalid model identifier."
              }
            }

Ensure to check for error codes and handle them appropriately in your implementation.