Skip to content

LLM Models

LLM models are the language model connections registered in NetOrca. AI processors and validators reference a model by ID. You register a model once with its provider credentials, then reuse it across multiple processors and validators.

Accessed via client.llm_models.

Supported providers

provider Description
openai OpenAI (GPT models)
openai_assistant OpenAI Assistants API
anthropic Anthropic (Claude models)
mistral Mistral AI
azure Azure OpenAI
xai xAI (Grok)
gemini Google Gemini
cohere Cohere
genai Google Gen AI
custom Custom or self-hosted endpoint

Model properties

Property Type Description
id int Model registration ID
name str Display name
provider str Provider key (see table above)
is_active bool Whether the model is active
created datetime Creation timestamp
modified datetime Last modified timestamp

Methods

list(**filters)

Returns a lazy generator of all registered LLM models.

Filters:

Filter Type Description
ordering str Sort field — prefix with - for descending
for model in client.llm_models.list():
    print(model.id, model.name, model.provider, model.is_active)

filter(**filters)

Same as list() but returns all results as a list. Accepts the same filters.

models = client.llm_models.filter()
print(f"{len(models)} models registered")

get(id)

Retrieves a single LLM model registration by ID.

model = client.llm_models.get(1)

print(model.id)
print(model.name)
print(model.provider)
print(model.is_active)
print(model.created)
print(model.modified)

create(data)

Registers a new LLM model. The API key is stored securely by NetOrca and used when the model is called.

Field Type Required Description
name str yes Display name for this registration
provider str yes Provider key (see table above)
model_name str yes The model identifier used by the provider
api_key str yes API key for authenticating with the provider
active bool no Whether to enable immediately (default: False)
# Register an OpenAI model
model = client.llm_models.create({
    "name": "gpt-4o",
    "provider": "openai",
    "model_name": "gpt-4o",
    "api_key": "sk-...",
    "active": True
})
print(model.id)

# Register an Anthropic model
model = client.llm_models.create({
    "name": "claude-sonnet",
    "provider": "anthropic",
    "model_name": "claude-sonnet-4-6",
    "api_key": "sk-ant-...",
    "active": True
})

# Register a custom self-hosted model
model = client.llm_models.create({
    "name": "internal-llm",
    "provider": "custom",
    "model_name": "llama-3",
    "api_key": "internal-key",
    "active": True
})

update(id, data, partial=True)

Updates a model registration — for example to rotate the API key or toggle the active flag. Defaults to PATCH.

Parameter Type Description
id int Model ID
data dict Fields to update
partial bool True (default) = PATCH, False = PUT
# Rotate the API key
client.llm_models.update(1, {"api_key": "sk-new-key..."})

# Deactivate a model
client.llm_models.update(1, {"active": False})

delete(id)

Permanently removes a model registration. Any processors or validators referencing this model will stop working.

client.llm_models.delete(1)

test_connection(data)

Tests that NetOrca can reach and authenticate with the model provider using the supplied credentials. Does not create or modify any records — it is a dry-run connectivity check. Returns a dict with the test result.

Field Type Required Description
provider str yes Provider key to test
api_key str yes API key to authenticate with
model_name str no Specific model to test against
result = client.llm_models.test_connection({
    "provider": "openai",
    "model_name": "gpt-4o",
    "api_key": "sk-..."
})
print(result)  # {"status": "ok"} or error details

get_active()

Returns all model registrations where is_active=True as a list. Useful for checking which models are available for use in processors.

active = client.llm_models.get_active()
for model in active:
    print(model.id, model.name, model.provider)