Git Product home page Git Product logo

furiosa-client's Introduction

Furiosa Web Service API Client

This is a client of Furiosa Web service API.

Example

To run the following example, you should get an API key and set the key according to the instruction.

use furiosa_client::{FuriosaClient, SourceFormat, TargetFormat};

let target_npu_spec: serde:json::Value = serde_yaml::from_str(include_str!("../configs/64dpes.yml")).unwrap();
let compiler_config: Value = serde_json::from_str("{}").unwrap();

let client = FuriosaClient::new().unwrap();
let binary = std::fs::read("models/tflite/MNISTnet_uint8_quant.tflite").expect("fail to read");
let request = CompileRequest::new(target_npu_spec, binary).compile_config(compiler_config);
let result: Box<[u8]> = client.compile(request).unwrap();

Please see a full example at the integration tests.

Building

The library embeds the API endpoint depending on a specified cargo feature. By default, cargo build will embed the sandbox API endpoint for testing and development.

If you build with the feature 'local_api', it will embed the http://localhost:8080/api/v1 for the API endpoint. It will be useful for debugging.

To build the library and executable files using local API endpoint:

cargo build --features "local_api"

To build the library and executable files using production API endpoint:

cargo build --release --features "production_api"

Both require API keys. Please watch this video in order to learn how to generate API keys.

How to set API keys

Shell environment variables

Please set the two environment variables as follow and then run your program:

export FURIOSA_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
export FURIOSA_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYY

Credential file

Please put your API keys at $HOME/.furiosa/credential as follow:

FURIOSA_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
FURIOSA_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYY

furiosa-client's People

Contributors

dkim-furiosa avatar hyunsik avatar kstreee-furiosa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

furiosa-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.