npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

nader-test-agentkit-opacity

v0.0.4

Published

Opacity adapter for verifiable inference in EigenLayer AgentKit

Downloads

18

Readme

@layr-labs/agentkit-opacity

Opacity adapter for verifiable inference in EigenLayer AgentKit. This adapter integrates with Cloudflare's AI Gateway and Opacity's zkTLS proof system to provide verifiable AI inference capabilities.

Installation

npm install @layr-labs/agentkit-opacity
# or
yarn add @layr-labs/agentkit-opacity
# or
pnpm add @layr-labs/agentkit-opacity

Features

  • 🔒 Verifiable AI inference using Opacity's zkTLS proofs
  • 🤖 Support for OpenAI and Anthropic models through Cloudflare AI Gateway
  • ✅ Proof generation and verification
  • 🛠️ Highly configurable model parameters
  • 💬 Full chat conversation support
  • 🎯 Advanced sampling options (top-p, top-k)

Usage

import { OpacityAdapter, ModelProvider, ChatMessage } from '@layr-labs/agentkit-opacity';

// Initialize the adapter
const adapter = new OpacityAdapter({
  teamId: process.env.OPACITY_TEAM_ID!,
  teamName: process.env.OPACITY_TEAM_NAME!,
  apiKey: process.env.OPACITY_API_KEY!,
  opacityProverUrl: process.env.OPACITY_PROVER_URL!,
  modelProvider: ModelProvider.ANTHROPIC, // or ModelProvider.OPENAI
});

// Simple text generation with a single prompt
const simpleResult = await adapter.generateText('What is the meaning of life?', {
  model: 'gpt-4oo',
  temperature: 0.7,
  maxTokens: 1000,
});

// Chat conversation with multiple messages
const conversation: ChatMessage[] = [
  {
    role: 'system',
    content: 'You are a helpful AI assistant.'
  },
  {
    role: 'user',
    content: 'What is quantum computing?'
  },
  {
    role: 'assistant',
    content: 'Quantum computing is a type of computing that uses quantum phenomena...'
  },
  {
    role: 'user',
    content: 'Can you explain quantum entanglement?'
  }
];

const chatResult = await adapter.generateText(conversation, {
  model: 'claude-3-5-sonnet-20241022',
  temperature: 0.7,
  maxTokens: 4096,
  topP: 0.9,
});

console.log('Generated text:', chatResult.content);
console.log('Proof:', chatResult.proof);

// Verify the proof
const isValid = await adapter.verifyProof(chatResult.proof);
console.log('Proof is valid:', isValid);

Configuration

Environment Variables

OPACITY_TEAM_ID=your_team_id
OPACITY_TEAM_NAME=your_team_name
OPACITY_API_KEY=your_api_key
OPACITY_PROVER_URL=https://your-opacity-prover-url

Adapter Options

The adapter supports various configuration options:

interface OpacityAdapterConfig {
  teamId: string;
  teamName: string;
  apiKey: string;
  modelProvider?: ModelProvider; // OPENAI or ANTHROPIC
  opacityProverUrl: string;
  gatewayUrl?: string;
}

Chat Messages

You can pass a conversation history using the ChatMessage interface:

interface ChatMessage {
  role: 'system' | 'user' | 'assistant';
  content: string;
}

Model Options

When calling generateText, you can customize the model behavior:

interface GenerateTextOptions {
  model?: string;                // Model name (e.g., 'gpt-4oo', 'claude-3-5-sonnet-20241022')
  temperature?: number;          // Controls randomness (0-1)
  maxTokens?: number;           // Maximum tokens to generate
  systemPrompt?: string;        // System prompt for single-prompt generation
  topP?: number;                // Nucleus sampling parameter (0-1)
  topK?: number;                // Top-k sampling parameter
}

Supported Models

OpenAI Models

  • gpt-4oo
  • gpt-4o-mini

Anthropic Models

  • claude-3-5-sonnet-20241022
  • claude-3-opus-20240229
  • claude-3-sonnet-20240229
  • claude-3-5-haiku-20241022

Each model comes with optimized default parameters that can be overridden using GenerateTextOptions.

Error Handling

The adapter throws the following error types:

  • ProofGenerationError: When proof generation fails
  • ProofVerificationError: When proof verification fails

Contributing

Please read the contributing guidelines in the root of the monorepo for details on our code of conduct and the process for submitting pull requests.

License

MIT License - see the LICENSE file for details.