🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@nomic-ai/atlas

Package Overview
Dependencies
Maintainers
0
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomic-ai/atlas

This library provides a TypeScript client for the Nomic API that allows you to work with datasets and embedding models hosted at atlas.nomic.ai.

0.12.0
latest
npm
Version published
Weekly downloads
879
24.15%
Maintainers
0
Weekly downloads
 
Created
Source

Nomic-ts

This library provides a TypeScript client for the Nomic API that allows you to work with datasets and embedding models hosted at atlas.nomic.ai.

Quick Start

Quick start:

import { embed } from '@nomic-ai/atlas';

embed(['so much depends upon', 'a red wheel barrow'], `nk-123456789`).then(
  (embeddings) => console.log({ embeddings })
);

or if your key is already in an environment variable at ATLAS_API_KEY:

import { embed } from '@nomic-ai/atlas';

embed(['glazed with rain water', 'beside the white chickens']).then(
  (embeddings) => console.log({ embeddings })
);

Managing API keys

All operations require a nomic API key linked to your account. To generate an API key, visit https://atlas.nomic.ai/ while logged in to your account and click on the API key tab under the organization.

API key as env variable

Once you have the API key, create a file in project root directory called .env In it, put the following line:

ATLAS_API_KEY=your-api-key

If running in an environment like Vercel or Heroku, you can set the environment variable through the hosting environment.

API key as argument

Alternatively, pass the api key as a param to AtlasUser:

AtlasUser({ apiKey: 'your-api-key' });

Setting the tenant environment

By default, this will access the production version of Atlas. This is probably what you want.

If you are using a custom tenant of Atlas, you will define the following additional variables:

ATLAS_FRONTEND_DOMAIN=your.frontend.domain
ATLAS_API_DOMAIN=your.api.domain

Design

This library is designed to be used in a browser or in Node.js. It is written in TypeScript and compiled to JavaScript.

Since the precise mechanism for calls differs in the browser as opposed to node, all calls are handler by an AtlasUser interface.

FAQs

Package last updated on 08 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts