nous-inference-integration

Build standalone scripts and services that call the OpenAI-compatible Nous Portal inference API outside the Hermes agent loop.

Updated May 28, 2026
One-click install
npx skills add https://github.com/patty-chow/the-stable --skill nous-inference-integration-patty-chow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nous-inference-integration
Source: https://github.com/patty-chow/the-stable/tree/main/skills/mlops/nous-inference-integration
Command: npx skills add https://github.com/patty-chow/the-stable --skill nous-inference-integration-patty-chow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, pymongo, and includes scripts (resource) and references (resource) components.

What problem does it solve? Standalone services like daily crons, monitors, and multi-model arenas cannot reuse the Hermes OAuth session because Nous access tokens expire in ~15 minutes and refresh tokens are single-use and rotating, so calling the refresh endpoint from your own code revokes the entire shared session. This Skill provides the correct integration path: minting a dedicated long-lived agent key, discovering exact served model names, and handling reasoning-model response quirks. ## Core Features & Use Cases - Auth done right: Explains the single-use rotating refresh-token trap and directs you to mint a static agent key in the Nous Portal instead of borrowing nous_auth.json. - Model discovery and request shape: Includes a script to probe /v1/models with an agent key and filter by family, plus the OpenAI-compatible chat-completions request pattern for ~265 models across anthropic/, openai/, google/, deepseek/, and x-ai/. - Reasoning-model robustness: Handles empty content fields by falling back to the reasoning field and sizing max_tokens generously for thinking models. - Use Case: Build a daily stock-trading arena where four models (Opus, GPT-5, Gemini, DeepSeek) each receive identical prompts through one Nous subscription, decide trades via a two-stage screen-then-decide flow, and persist results to a local DocumentDB store with a JSONL fallback that never loses data. ## Quick Start Ask the agent to help you mint a Nous Portal agent key and write a standalone Python script that calls the Nous inference API with a chosen model on a daily schedule.

Frequently Asked Questions about nous-inference-integration

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

FAQPage Schema
How do I call the Nous inference API from a standalone Python script?▼

Mint a long-lived agent key in the Nous Portal API Keys page, store it in your service's own env file, and send it as a static Bearer token to https://inference-api.nousresearch.com/v1/chat/completions using the standard OpenAI-compatible request shape.

Why does reusing the Hermes Nous OAuth token break authentication?▼

Nous access tokens expire in about 15 minutes and refresh tokens are single-use and rotating. If external code calls the refresh endpoint, the server rotates the token, Hermes's next refresh uses the retired one, and the server revokes the entire session as a token-theft signal.

How do I find exact model names served by Nous inference?▼

Run the included list_nous_models.py script with a NOUS_API_KEY agent key to query /v1/models and filter by family such as gpt-5, gemini, deepseek, or opus. Model ids use a provider/model shape like anthropic/claude-opus-4.8 and must match exactly or the API returns 404.

Why does a reasoning model return empty content in the API response?▼

Reasoning models like DeepSeek v4 spend tokens on a thinking phase, so content can be null while the answer sits in a reasoning field, or max_tokens runs out mid-thought. Fall back to the reasoning field and set max_tokens to at least 2000 even for short answers.

Can I run DocumentDB locally as a datastore for a standalone service?▼

Yes, run the documentdb-local container under Colima on macOS with INIT_DATA=false and a named volume to avoid a seed-script crash-loop on restart. Connect via pymongo with TLS and SCRAM-SHA-256, and keep a JSONL dual-write fallback so a down database never loses writes.

What rate limits apply to Nous inference API calls?▼

Limits are tier-based: Free allows 50 RPM and 500k TPM, Default-paid 180/720k, Plus 400/4M, Super 800/8M, and Ultra 1600/16M. On lower tiers serialize or stagger parallel calls, since a sub-second 429 indicates an RPM burst hit.