neuronpedia-inference-client
v1.9.1
Published
OpenAPI client for neuronpedia-inference-client
Downloads
165
Readme
[email protected]
A TypeScript SDK client for the localhost API.
Usage
First, install the SDK from npm.
npm install neuronpedia-inference-client --saveNext, try it out.
import {
Configuration,
DefaultApi,
} from 'neuronpedia-inference-client';
import type { ActivationAllBatchPostOperationRequest } from 'neuronpedia-inference-client';
async function example() {
console.log("🚀 Testing neuronpedia-inference-client SDK...");
const config = new Configuration({
// To configure API key authorization: SimpleSecretAuth
apiKey: "YOUR API KEY",
});
const api = new DefaultApi(config);
const body = {
// ActivationAllBatchPostRequest
activationAllBatchPostRequest: ...,
} satisfies ActivationAllBatchPostOperationRequest;
try {
const data = await api.activationAllBatchPost(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);Documentation
API Endpoints
All URIs are relative to /v1
| Class | Method | HTTP request | Description | ----- | ------ | ------------ | ------------- DefaultApi | activationAllBatchPost | POST /activation/all-batch | For a given batch of prompts, get the top activating features for a set of SAEs (eg gemmascope-res-65k), or specific SAEs in the set of SAEs (eg 0-gemmascope-res-65k, 5-gemmascope-res-65k). Also has other customization options. DefaultApi | activationAllPost | POST /activation/all | For a given prompt, get the top activating features for a set of SAEs (eg gemmascope-res-65k), or specific SAEs in the set of SAEs (eg 0-gemmascope-res-65k, 5-gemmascope-res-65k). Also has other customization options. DefaultApi | activationSingleBatchPost | POST /activation/single-batch | Given a batch of text prompts, returns the activation values for a single SAE latent or custom vector+hook. DefaultApi | activationSinglePost | POST /activation/single | Given a text prompt, returns the activation values for a single SAE latent or custom vector+hook. DefaultApi | activationSourcePost | POST /activation/source | For a given prompt, get the top activating features for a source (eg 0-gemmascope-res-65k or 5-gemmascope-res-65k), and return the results as a 3D array of prompt x prompt_token x feature_index. DefaultApi | activationTopkByTokenBatchPost | POST /activation/topk-by-token-batch | For a given batch of prompts, get the top activating features at each token position for a single SAE. DefaultApi | activationTopkByTokenPost | POST /activation/topk-by-token | For a given prompt, get the top activating features at each token position for a single SAE. DefaultApi | steerCompletionChatPost | POST /steer/completion-chat | For a given prompt, complete it by steering with the given feature or vector DefaultApi | steerCompletionPost | POST /steer/completion | For a given prompt, complete it by steering with the given feature or vector DefaultApi | tokenizePost | POST /tokenize | Tokenize input text for a given model DefaultApi | utilSaeTopkByDecoderCossimPost | POST /util/sae-topk-by-decoder-cossim | Given a specific vector or SAE feature, return the top features by cosine similarity in the same SAE DefaultApi | utilSaeVectorPost | POST /util/sae-vector | Get the raw vector for an SAE feature
Models
- ActivationAllBatchPost200Response
- ActivationAllBatchPost200ResponseResultsInner
- ActivationAllBatchPostRequest
- ActivationAllPost200Response
- ActivationAllPost200ResponseActivationsInner
- ActivationAllPostRequest
- ActivationSingleBatchPost200Response
- ActivationSingleBatchPost200ResponseResultsInner
- ActivationSingleBatchPostRequest
- ActivationSinglePost200Response
- ActivationSinglePost200ResponseActivation
- ActivationSinglePostRequest
- ActivationSourcePost200Response
- ActivationSourcePost200ResponseResultsInner
- ActivationSourcePostRequest
- ActivationTopkByTokenBatchPost200Response
- ActivationTopkByTokenBatchPost200ResponseResultsInner
- ActivationTopkByTokenBatchPostRequest
- ActivationTopkByTokenPost200Response
- ActivationTopkByTokenPost200ResponseResultsInner
- ActivationTopkByTokenPost200ResponseResultsInnerTopFeaturesInner
- ActivationTopkByTokenPostRequest
- NPFeature
- NPLogprob
- NPLogprobTop
- NPSteerChatMessage
- NPSteerChatResult
- NPSteerCompletionResponseInner
- NPSteerFeature
- NPSteerMethod
- NPSteerType
- NPSteerVector
- SteerCompletionChatPost200Response
- SteerCompletionChatPost200ResponseAssistantAxisInner
- SteerCompletionChatPost200ResponseAssistantAxisInnerTurnsInner
- SteerCompletionChatPostRequest
- SteerCompletionPost200Response
- SteerCompletionRequest
- TokenizePost200Response
- TokenizePostRequest
- UtilSaeTopkByDecoderCossimPost200Response
- UtilSaeTopkByDecoderCossimPost200ResponseTopkDecoderCossimFeaturesInner
- UtilSaeTopkByDecoderCossimPostRequest
- UtilSaeVectorPost200Response
- UtilSaeVectorPostRequest
Authorization
Authentication schemes defined for the API:
SimpleSecretAuth
- Type: API key
- API key parameter name:
X-SECRET-KEY - Location: HTTP header
About
This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:
- API version:
1.9.0 - Package version:
1.9.1 - Generator version:
7.19.0 - Build package:
org.openapitools.codegen.languages.TypeScriptFetchClientCodegen
The generated npm module supports the following:
- Environments
- Node.js
- Webpack
- Browserify
- Language levels
- ES5 - you must have a Promises/A+ library installed
- ES6
- Module systems
- CommonJS
- ES6 module system
Development
Building
To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:
npm install
npm run buildPublishing
Once you've built the package, you can publish it to npm:
npm publish