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.1.0
  • Package version: 1.2.0
  • Generator version: 7.12.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_post_request = neuronpedia_inference_client.ActivationAllPostRequest() # ActivationAllPostRequest | 

    try:
        # 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.
        api_response = api_instance.activation_all_post(activation_all_post_request)
        print("The response of DefaultApi->activation_all_post:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->activation_all_post: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to /v1

Class Method HTTP request Description
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_post POST /activation/single Given a text prompt, returns the activation values for a single SAE latent or custom vector+hook.
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.2.0.tar.gz (30.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.2.0-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for neuronpedia_inference_client-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9931065b9ff2c136db401a49447f0a8329a80b66a7bbca30ebc08cb1d8757c14
MD5 11a83bcac98893e704727a7380a0bf38
BLAKE2b-256 f006b6855dfd59a23d5a345890c73be7d6f0f92128ce54325721ff2cdfc7dcdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neuronpedia_inference_client-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86614d8f8352bdd8191d48c5970713ca4c9007eb4c37dd27b0416f30514cb0b3
MD5 3b30aee80876995d3d9e56ba787ca5cc
BLAKE2b-256 4a20370474bd942fc09674e23f74fee42805cb504721fddb4f630282a1d8533f

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