Skip to main content

health

Returns whether the server is running, which embedding provider and model are configured, and how many items are stored versus the global cap (default 100,000).
client.health() -> dict[str, Any]
API: GET /health — see Health

Examples

from moorcheh import MoorchehClient, MoorchehApiError

with MoorchehClient("http://localhost:8080") as client:
    health = client.health()

    print(health["status"])              # ok
    print(health["embedding_provider"])  # ollama, openai, or cohere
    print(health["model"])               # e.g. embed-v4.0
    print(health["items"])               # current count across all namespaces
    print(health["max_items"])           # 100000
    print(health["remaining"])           # max_items - items

Returns

status
string
Server health. "ok" when the API is running and reachable.
embedding_provider
string
Active provider: ollama, openai, or cohere.
model
string
Embedding model id for the configured provider. Used for text documents and text search queries.
items
number
Total number of stored items across all namespaces (text documents + vectors).
max_items
number
Global storage cap for this instance. Default is 100000.
remaining
number
How many new items you can still add: max_items - items. Uploads that would exceed this return 409.
Example return value
{
  "status": "ok",
  "model": "nomic-embed-text",
  "items": 7,
  "max_items": 100000,
  "remaining": 99993,
}
Field order in the response may vary; all fields above are always present on success.

Error Handling

Non-2xx responses raise MoorchehApiError (for example if the server is not running or unreachable).
from moorcheh import MoorchehApiError

try:
    with MoorchehClient() as client:
        health = client.health()
except MoorchehApiError as e:
    print(e.status_code, e.body)