AI on demand: opendatalab/MinerU2.5-2509-1.2B: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
stepping stone AG is proud to serve customers with current Language Models and OCR solutions.
== Calling the model ==
All of our LLM services are reachable from https://llm.stoney-cloud.com/.
<syntaxhighlight lang="bash">
# Set your personal key:
STONEY_KEY=sk-...
 
# Set the desired model:
MODEL=MinerU2.5-2509-1.2B


== Calling a model ==
# Set the desired document to run OCR against:
We assume you've received your API key from us in our usual manner. The route above is available in the usual OpenAI-compatible manner.
FILE_PATH=document.png
For instance, receiving a list of available model is done via https://llm.stoney-cloud.com/v1/models which requires you to provide your key.
As an initial service we provide access to some OCR models.


<syntaxhighlight lang="bash">
# Encode document contents with Base64 and detect MIME type:
STONEY_KEY=<your-key-here>
FILE_CONTENT_BASE64=$(base64 -w 0 < "$FILE_PATH")
MODEL_NAME=<hosted-model-name-here>
FILE_MIME_TYPE=$(file --brief --mime-type "$FILE_PATH")


curl -s https://llm.stoney-cloud.com/v1/chat/completions \
curl https://llm.stoney-cloud.com/v1/chat/completions \
  -H "Authorization: Bearer $STONEY_KEY" \
        --silent --fail --show-error \
  -H "Content-Type: application/json" \
        --header "Authorization: Bearer $STONEY_KEY" \
  -d "{
        --header 'Content-Type: application/json' \
    \"model\":\"${MODEL_NAME}\",
        --data '{
    \"messages\":[
                "model": "'"$MODEL"'",
      {\"role\":\"user\",\"content\":\"Describe an imaginary document.\"}
                "messages": [{
    ],
                        "role": "user",
    \"max_tokens\":2000}" | jq .
                        "content": [{
                                "type": "image_url",
                                "image_url": {
                                        "url": "data:'"$FILE_MIME_TYPE"';base64,'"$FILE_CONTENT_BASE64"'"
                                }
                        }]
                }],
                "max_tokens": 4096,
                "temperature": 0.2,
                "top_p": 0.9
        }' \
        | jq
</syntaxhighlight>
</syntaxhighlight>


== Inspecting your usage ==
Example output:
 
<syntaxhighlight lang="json">
<syntaxhighlight lang="bash">
{
curl -s https://llm.stoney-cloud.com/v1/usage  -H "Authorization: Bearer $STONEY_KEY" | jq .
  "id": "chatcmpl-928cc308fa758fc8",
  "object": "chat.completion",
  "created": 1778491655,
  "model": "MinerU2.5-2509-1.2B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "This is a lot of 12 point text to test theOCR code and see if it works on all types of file format. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox.",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [],
        "reasoning": null,
        "reasoning_content": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": null,
  "usage": {
    "prompt_tokens": 412,
    "total_tokens": 480,
    "completion_tokens": 68,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
   "prompt_token_ids": null,
  "kv_transfer_params": null
}
</syntaxhighlight>
</syntaxhighlight>
We issue one key per model for now. The usage is thus per-model-per-key.


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

Latest revision as of 11:28, 11 May 2026

Calling the model

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

# Set the desired model:
MODEL=MinerU2.5-2509-1.2B

# Set the desired document to run OCR against:
FILE_PATH=document.png

# Encode document contents with Base64 and detect MIME type:
FILE_CONTENT_BASE64=$(base64 -w 0 < "$FILE_PATH")
FILE_MIME_TYPE=$(file --brief --mime-type "$FILE_PATH")

curl https://llm.stoney-cloud.com/v1/chat/completions \
        --silent --fail --show-error \
        --header "Authorization: Bearer $STONEY_KEY" \
        --header 'Content-Type: application/json' \
        --data '{
                "model": "'"$MODEL"'",
                "messages": [{
                        "role": "user",
                        "content": [{
                                "type": "image_url",
                                "image_url": {
                                        "url": "data:'"$FILE_MIME_TYPE"';base64,'"$FILE_CONTENT_BASE64"'"
                                }
                        }]
                }],
                "max_tokens": 4096,
                "temperature": 0.2,
                "top_p": 0.9
        }' \
        | jq

Example output:

{
  "id": "chatcmpl-928cc308fa758fc8",
  "object": "chat.completion",
  "created": 1778491655,
  "model": "MinerU2.5-2509-1.2B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "This is a lot of 12 point text to test theOCR code and see if it works on all types of file format. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox. The quick brown dog jumped over the lazy fox.",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [],
        "reasoning": null,
        "reasoning_content": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": null,
  "usage": {
    "prompt_tokens": 412,
    "total_tokens": 480,
    "completion_tokens": 68,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "kv_transfer_params": null
}