Using Local Server
Argmax Local Server is an on-device real-time transcription WebSocket server that is designed to make migration from cloud-based inference services seamless. Watch the demo video to see it in action:
Request the Argmax Local Server binary from Argmax before getting started.
API Compatibility
Argmax Local Server is API-compatible with Deepgram Speech to Text API (Live).
If you already have Deepgram integration in your project, we recommend keeping the implementation intact and simply pointing the client to localhost as demonstrated below.
Node
@argmaxinc/local-server is the official Node package for deploying Argmax Local Server in Node-based (e.g. Electron) applications. For API reference, please see the Node package documentation.
Installation
npm install @argmaxinc/local-server
Basic Example
import { ArgmaxLocalServer } from '@argmaxinc/local-server';
const server = new ArgmaxLocalServer({
binaryPath: '/path/to/argmax-local-server',
});
// Start the server
await server.startProcess();
// Initialize with a model
await server.init({
apiKey: 'ax_***', // Argmax API key
model: 'parakeet-v3_494MB',
modelRepo: 'argmaxinc/parakeetkit-pro'
});
// Wait for ready
await server.waitForReady();
// Get current status
const status = await server.status();
console.log('Server status:', status);
// Create transcriber for real-time audio
const transcriber = server.createTranscriber({ source: 'microphone' });
// Set up transcription event handling
transcriber.on('transcription', (result) => {
console.log('Transcript:', result.transcript);
if (result.isFinal) {
console.log('Final result with confidence:', result.confidence);
}
});
// Connect and start transcribing
await transcriber.connect();
// Send audio data (from microphone, file, or stream)
// transcriber.sendAudioBuffer(audioBuffer);
// Clean shutdown
await transcriber.close();
await server.shutdown();
await server.stopProcess();
Migrating from Deepgram
If you are already using the Deepgram SDK in your project, you can reuse that implementation to connect to your Argmax Local Server instead of Deepgram's cloud service by pointing to localhost
onst { createClient, LiveTranscriptionEvents } = require("@deepgram/sdk");
// Instead of connecting to Deepgram cloud:
// const deepgram = createClient(process.env.DEEPGRAM_API_KEY);
// Connect to Argmax Local Server:
// Note: Use your Argmax API key (ax_...) instead of Deepgram API key
const deepgram = createClient(process.env.DEEPGRAM_API_KEY, {
global: { websocket: { options: { url: "ws://localhost:50060" } } }
});
// Use the same Deepgram SDK API as usual
const connection = deepgram.listen.live({
model: "this-is-ignored", // ignored
language: "en",
smart_format: true, // ignored
interim_results: true,
encoding: 'linear16',
channels: 1,
sampleRate: 48000
});
connection.on(LiveTranscriptionEvents.Open, () => {
console.log("Connection opened.");
});
connection.on(LiveTranscriptionEvents.Transcript, (data) => {
console.log(data.channel.alternatives[0].transcript);
});
CLI Usage
# Start server
npx @argmaxinc/local-server start --binary /path/to/argmax-local-server
# Start with launch wrapper for development
npx @argmaxinc/local-server start --launch-wrapper /path/to/wrapper --binary /path/to/argmax-local-server
# Check status
npx @argmaxinc/local-server status
# Initialize with model
npx @argmaxinc/local-server init --api-key your-key --model tiny.en
# Real-time transcription
npx @argmaxinc/local-server transcribe --api-key your-key
Python
Documentation coming soon.
Other languages
Documentation coming soon.