AI on demand: Apertus: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
(Created page with "== Calling the model == <syntaxhighlight lang="bash"> # Set your personal key STONEY_KEY=sk-... # Set the desired model MODEL_ID=swiss-ai/Apertus-70B-Instruct-2509 curl -s https://llm.stoney-cloud.com/v1/chat/completions \ -H "Authorization: Bearer $STONEY_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "swiss-ai/Apertus-70B-Instruct-2509", "messages": [ {"role": "user", "content": "Say hello"} ], "max_tokens": 10 }' | jq . <...")
 
 
(3 intermediate revisions by the same user not shown)
Line 11: Line 11:
   -H "Content-Type: application/json"  \
   -H "Content-Type: application/json"  \
   -d '{
   -d '{
     "model": "swiss-ai/Apertus-70B-Instruct-2509",
     "model": "'"$MODEL_ID"'",
     "messages": [
     "messages": [
       {"role": "user", "content": "Say hello"}
       {"role": "user", "content": "Say hello"}
     ],
     ],
     "max_tokens": 10
     "max_tokens": 100
   }' | jq .
   }' \
  | jq .
</syntaxhighlight>
 
Example output:
<syntaxhighlight lang="json">
{
  "id": "chatcmpl-936c65ace55c4524",
  "object": "chat.completion",
  "created": 1774862931,
  "model": "swiss-ai/Apertus-70B-Instruct-2509",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! It's nice to meet you. As Apertus, I'm here to provide assistance, answer your questions, and help make your day a bit better. How may I assist you today?",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [],
        "reasoning": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": null,
  "usage": {
    "prompt_tokens": 63,
    "total_tokens": 104,
    "completion_tokens": 41,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "kv_transfer_params": null
}
</syntaxhighlight>
</syntaxhighlight>


[[Category:AI on demand]]
[[Category:AI on demand]]

Latest revision as of 14:53, 30 March 2026

Calling the model

# Set your personal key
STONEY_KEY=sk-...

# Set the desired model
MODEL_ID=swiss-ai/Apertus-70B-Instruct-2509

curl -s https://llm.stoney-cloud.com/v1/chat/completions \
  -H "Authorization: Bearer $STONEY_KEY" \
  -H "Content-Type: application/json"   \
  -d '{
    "model": "'"$MODEL_ID"'",
    "messages": [
      {"role": "user", "content": "Say hello"}
    ],
    "max_tokens": 100
  }' \
  | jq .

Example output:

{
  "id": "chatcmpl-936c65ace55c4524",
  "object": "chat.completion",
  "created": 1774862931,
  "model": "swiss-ai/Apertus-70B-Instruct-2509",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! It's nice to meet you. As Apertus, I'm here to provide assistance, answer your questions, and help make your day a bit better. How may I assist you today?",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [],
        "reasoning": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": null,
  "usage": {
    "prompt_tokens": 63,
    "total_tokens": 104,
    "completion_tokens": 41,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "kv_transfer_params": null
}