somnia-agents-llm-inference

Invoke a deterministic on-chain language model from smart contracts.

1|1|Updated May 8, 2026
One-click install
npx skills add https://github.com/emrestay/somnia-agents-skills --skill somnia-agents-llm-inference
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: somnia-agents-llm-inference
Source: https://github.com/emrestay/somnia-agents-skills/tree/main/skills/somnia-agents-llm-inference
Command: npx skills add https://github.com/emrestay/somnia-agents-skills --skill somnia-agents-llm-inference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables smart contracts to access a deterministic on-chain LLM, ensuring consistent AI outputs across validators.

Core Features & Use Cases

  • On-chain LLM Invocation: Call a fixed-seed, temperature=0 language model for predictable results in applications like moderation, classification, or decision-making.
  • Multi-Function API: Supports string, number, multi-turn chat, and tool- calling inference methods tailored for complex AI interactions.
  • Use Case: Build on-chain governance bots that classify comments or generate summaries with guaranteed deterministic outputs.

Quick Start

Use the inferString function with a prompt and specify allowed values to classify content on-chain.

Frequently Asked Questions about somnia-agents-llm-inference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get deterministic AI outputs for smart contracts?▼

Deterministic AI outputs for smart contracts are achieved by invoking an on-chain LLM with a fixed seed and temperature=0. This ensures validators compute consistent, repeatable classification and moderation decisions across decentralized applications.

Can smart contracts use multi-turn chat and tool calling for on-chain AI moderation?▼

Yes, smart contracts can use multi-turn chat and tool calling for on-chain AI moderation. The interface supports string, number, and multi-turn inference methods, enabling complex structured decision-making in decentralized applications.

What is the best way to classify content on-chain with guaranteed consistent results?▼

The best way to classify content on-chain with guaranteed consistency is using the inferString function. You provide a prompt and specify allowed values, ensuring the deterministic LLM returns predictable classification results across all validators.

Why do my smart contract AI governance bots return inconsistent moderation decisions?▼

Inconsistent moderation decisions in smart contracts occur when LLM temperature settings vary. Using a fixed-seed, temperature=0 on-chain LLM inference interface ensures all validators process governance tasks identically, eliminating output discrepancies.

Does on-chain LLM inference support constrained outputs for decentralized applications?▼

Yes, on-chain LLM inference supports constrained outputs for decentralized applications. By specifying allowed values during invocation, the deterministic model returns structured results strictly matching predefined constraints for reliable automated decision-making.