Welcome to token.place!

tokenplace is a peer-to-peer generative AI platform that pairs those in need of LLM compute with individuals donating spare resources, aiming to democratize AI access.


Try it out:


API

The token.place API is designed to be compatible with the OpenAI API format, making it easy to integrate with existing applications that use OpenAI's services.

GET /api/v1/models

Lists the available models.

Example Response:

{
  "object": "list",
  "data": [
    {
      "id": "llama-3-8b-instruct",
      "object": "model",
      "created": 1679351277,
      "owned_by": "token.place",
      "permission": [...],
      "root": "llama-3-8b-instruct",
      "parent": null
    }
  ]
}

GET /api/v1/models/{model_id}

Retrieves information about a specific model.

Example Response:

{
  "id": "llama-3-8b-instruct",
  "object": "model",
  "created": 1679351277,
  "owned_by": "token.place",
  "permission": [...],
  "root": "llama-3-8b-instruct",
  "parent": null
}

POST /api/v1/chat/completions

Creates a completion for the chat message.

Request Body:

{
  "model": "llama-3-8b-instruct",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ]
}

Example Response:

{
  "id": "chatcmpl-123abc456def",
  "object": "chat.completion",
  "created": 1677858242,
  "model": "llama-3-8b-instruct",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I assist you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}

POST /api/v1/completions

Creates a completion for the prompt (traditional completion API).

Request Body:

{
  "model": "llama-3-8b-instruct",
  "prompt": "Write a poem about AI",
  "max_tokens": 256
}

Example Response: (Same format as chat/completions)

GET /api/v1/public-key

Retrieves the server's public key for end-to-end encryption.

Example Response:

{
  "public_key": "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUl..."
}

Encrypted API Usage

For enhanced privacy, you can use end-to-end encryption with the API:

  1. Get the server's public key from /api/v1/public-key
  2. Generate your own RSA key pair on the client
  3. Encrypt your messages with the server's public key
  4. Send the encrypted request with "encrypted": true flag
  5. The server will encrypt its response with your public key

Example Encrypted Request:

{
  "model": "llama-3-8b-instruct",
  "encrypted": true,
  "client_public_key": "YOUR_PUBLIC_KEY_HERE",
  "messages": {
    "ciphertext": "ENCRYPTED_DATA_HERE",
    "cipherkey": "ENCRYPTED_AES_KEY_HERE",
    "iv": "INITIALIZATION_VECTOR_HERE"
  }
}

Roadmap

Check out the roadmap section of the README.

FAQ

Why token.place?

We believe in the democratization of AI. Projects like Folding@Home inspired us to leverage peer-to-peer technology for generative AI, making sophisticated language models accessible to everyone.

Is it really free?

Yes, thanks to our generous compute donors. We aim to keep it free, no strings attached, to ensure universal access to advanced AI.

How do I contribute?

You can contribute by donating compute resources or by participating in our community on GitHub. Every bit helps us grow and improve.

Learn more about our goals and how you can be a part of this initiative on our GitHub repository.

Privacy Notice

All communications are now end-to-end encrypted for enhanced privacy. For maximum security, consider self-hosting by following the README on the GitHub repository.