Skip to main content

Procedural Game Engine powered by IntentShield and LogicShield (BSL 1.1)

Project description

# Sovereign Engine

The Zero-Trust Procedural Game Engine. Built securely on the IntentShield and LogicShield architectures.

Sovereign Engine allows game developers to seamlessly integrate LLMs (Large Language Models) into their games to generate procedural dialogue, dynamic quests, and complex NPC interactions while absolutely guaranteeing that the AI's output mathematically adheres to your game's rules.

Installation

pip install sovereign-engine

Features

  • Deterministic Validation: The LogicShield backend forces the LLM to output perfect JSON.
  • Action Gatekeeper: A deeply integrated, ultra-fast IntentShield system intercepts the AI's intended actions.
  • Local First: Runs purely on your local graphics card natively via Ollama out of the box. No internet or API keys required.

Quick Start (Zero Config)

Sovereign Engine connects directly to Local Ollama by default. If Ollama is currently running on your machine, just initialize the engine.

from sovereign_engine.engine import ProceduralDialogueEngine

# Defaults to localhost:11434 with llama3.1:8b
engine = ProceduralDialogueEngine()

scene = engine.generate_node(
    player_state={"level": 5, "inventory": ["Iron Sword", "Shield"]},
    recent_history=["You enter a dark cavern and hear a low growl."],
    player_action="I walk forward with my shield raised."
)

print(scene)

Changing the Local Ollama Model

If you want to use a different model installed on your machine (like mistral, gemma, or deepseek), you simply pass the ollama_model parameter directly into the engine:

# Tell the engine exactly which local model to hit!
engine = ProceduralDialogueEngine(ollama_model="mistral:latest")

# Or an uncensored narrative model
engine = ProceduralDialogueEngine(ollama_model="hf.co/HauhauCS/Qwen3.5-27B-Uncensored")

Customizing Rules (LogicShield) & Actions (IntentShield)

You can easily expand the engine to enforce your own custom mechanics mathematically, or allow new verbs for the AI to take (like CRAFT or STEAL).

from sovereign_engine.logicshield.rules import Rule

my_rules = [
    Rule.less_than("gold_dropped", "max_loot")
]

engine = ProceduralDialogueEngine(
    ollama_model="llama3.1:8b",
    custom_actions=["STEAL", "CRAFT", "PERSUADE"], 
    custom_rules=my_rules
)

Cloud API Fallbacks

If you don't want to run locally via Ollama, you can fallback to the OpenRouter enterprise cloud by passing your key string directly:

# The Engine immediately routes to the cloud if a key is detected
engine = ProceduralDialogueEngine(api_key="sk-or-your-developer-key")

License

This project is licensed under the Business Source License 1.1 (BSL 1.1). For production or commercial use, you must obtain a separate commercial license from SovereignShield.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sovereign_engine-1.0.7.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sovereign_engine-1.0.7-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file sovereign_engine-1.0.7.tar.gz.

File metadata

  • Download URL: sovereign_engine-1.0.7.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for sovereign_engine-1.0.7.tar.gz
Algorithm Hash digest
SHA256 1883cc7d48817b78d5fc37af06e2c26b891e2ffc16c21f087e4e80edcf257718
MD5 44c3eaa96ca241b4ed48062c652ca98a
BLAKE2b-256 db5661628898b0c12fcba8a9ab4a42ce790bbf6ac061694f30ace91dc16105fd

See more details on using hashes here.

File details

Details for the file sovereign_engine-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for sovereign_engine-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 afd95fa016376b6e08bdf236b63ca173d3aff87da66bf21e3e5f2ec321f583a3
MD5 c15301783763018c033cc82c22eabe12
BLAKE2b-256 461a0a4b47c8f224738aee5a00d168bec3a41aa5e3d7b49f5445aed7bba2f26c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page