Neuronpedia - Inference Server
Project description
neuronpedia-inference-client
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.1.0
- Package version: 1.8.0
- Generator version: 7.11.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.8+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import neuronpedia_inference_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import neuronpedia_inference_client
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import neuronpedia_inference_client
from neuronpedia_inference_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = neuronpedia_inference_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: SimpleSecretAuth
configuration.api_key['SimpleSecretAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['SimpleSecretAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with neuronpedia_inference_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = neuronpedia_inference_client.DefaultApi(api_client)
activation_all_batch_post_request = neuronpedia_inference_client.ActivationAllBatchPostRequest() # ActivationAllBatchPostRequest |
try:
# 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.
api_response = api_instance.activation_all_batch_post(activation_all_batch_post_request)
print("The response of DefaultApi->activation_all_batch_post:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->activation_all_batch_post: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to /v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | activation_all_batch_post | 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 | activation_all_post | 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 | activation_single_batch_post | POST /activation/single-batch | Given a batch of text prompts, returns the activation values for a single SAE latent or custom vector+hook. |
| DefaultApi | activation_single_post | POST /activation/single | Given a text prompt, returns the activation values for a single SAE latent or custom vector+hook. |
| DefaultApi | activation_source_post | 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 | activation_topk_by_token_batch_post | 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 | activation_topk_by_token_post | POST /activation/topk-by-token | For a given prompt, get the top activating features at each token position for a single SAE. |
| DefaultApi | steer_completion_chat_post | POST /steer/completion-chat | For a given prompt, complete it by steering with the given feature or vector |
| DefaultApi | steer_completion_post | POST /steer/completion | For a given prompt, complete it by steering with the given feature or vector |
| DefaultApi | tokenize_post | POST /tokenize | Tokenize input text for a given model |
| DefaultApi | util_sae_topk_by_decoder_cossim_post | 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 | util_sae_vector_post | POST /util/sae-vector | Get the raw vector for an SAE feature |
Documentation For 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
- SteerCompletionChatPostRequest
- SteerCompletionPost200Response
- SteerCompletionRequest
- TokenizePost200Response
- TokenizePostRequest
- UtilSaeTopkByDecoderCossimPost200Response
- UtilSaeTopkByDecoderCossimPost200ResponseTopkDecoderCossimFeaturesInner
- UtilSaeTopkByDecoderCossimPostRequest
- UtilSaeVectorPost200Response
- UtilSaeVectorPostRequest
Documentation For Authorization
Authentication schemes defined for the API:
SimpleSecretAuth
- Type: API key
- API key parameter name: X-SECRET-KEY
- Location: HTTP header
Author
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuronpedia_inference_client-1.8.0.tar.gz.
File metadata
- Download URL: neuronpedia_inference_client-1.8.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.8 Darwin/25.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72b0ba3341caa8780b7132212048b587f6afd8e601b3af269e2a078e1e4771b1
|
|
| MD5 |
828756a4a4551d2064c069a491aa40a4
|
|
| BLAKE2b-256 |
094338dd08439271fd9ebb5f766f5620555f376dbf5778defa56f9867684342f
|
File details
Details for the file neuronpedia_inference_client-1.8.0-py3-none-any.whl.
File metadata
- Download URL: neuronpedia_inference_client-1.8.0-py3-none-any.whl
- Upload date:
- Size: 92.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.8 Darwin/25.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b885df668194efc40a09d5272e218aa717de617e7541cac3284282285f519cc4
|
|
| MD5 |
7e6ea1ec5ab994e8005f6a0afe760c71
|
|
| BLAKE2b-256 |
6e0851e89da6967405ab252d3f00032cc05ea583ce7aa87449b78ffa83f28bd2
|