Skip to main content

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.9.0
  • Package version: 1.9.1
  • Generator version: 7.19.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.9+

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

Documentation For Authorization

Authentication schemes defined for the API:

SimpleSecretAuth

  • Type: API key
  • API key parameter name: X-SECRET-KEY
  • Location: HTTP header

Author

johnny@neuronpedia.org

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

neuronpedia_inference_client-1.9.1.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuronpedia_inference_client-1.9.1-py3-none-any.whl (98.5 kB view details)

Uploaded Python 3

File details

Details for the file neuronpedia_inference_client-1.9.1.tar.gz.

File metadata

File hashes

Hashes for neuronpedia_inference_client-1.9.1.tar.gz
Algorithm Hash digest
SHA256 0edd16b416899288f538e57d0702371335b175d1906f45ebfab86220375589f2
MD5 a38bb1f1bd06f0a36557d31659052bd3
BLAKE2b-256 414956755710bc2ebd3c9e6ccb4c7d649225e86a12a1db5b43915f08bc774159

See more details on using hashes here.

File details

Details for the file neuronpedia_inference_client-1.9.1-py3-none-any.whl.

File metadata

File hashes

Hashes for neuronpedia_inference_client-1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bbc3f2934dbaae0f32d0109d14c557baa716e2a8f632830b893234ea95804a9
MD5 affd7881be23801a5ea7e95890fdc3ce
BLAKE2b-256 9eb7c7cd071622b057e9b8851defe9bf4431011a5d0e38b80dc5e42d940b5ea5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page