Skip to content

Commit

Permalink
Merge pull request #70 from ainize-team/docs/yoojin/readme
Browse files Browse the repository at this point in the history
Update module naming.
  • Loading branch information
yoojinko authored Oct 31, 2023
2 parents 65d31f4 + edcc632 commit f53026b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,37 @@ ainize.login(<YOUR_PRIVATE_KEY>);
```

### Deploy
You can deploy your AI model to ainize.
You can deploy your AI service to ainize.
```typescript
const model = await ainize.deploy(<CONFIGURATION>);
const service = await ainize.deploy(<CONFIGURATION>);
```
CONFIGURATION
- modelName: The name you want to deploying model.
- billingConfig: Billing configuration required for model usage.
- serviceName: The name you want to deploying service.
- billingConfig: Billing configuration required for service usage.
- depositAddress: The address for receiving AIN deposits.
- costPerToken: Cost per token for model usage.
- costPerToken: Cost per token for service usage.
- minCost: Minimum cost.
- maxCost: Maximum cost. (optional)

You can stop or run your model container. Model deployer only can use this.
You can stop or run your service container. Only service deployer can use this.
```typescript
model.stop();
model.run();
service.stop();
service.run();
```

### Using Model
You can use a model using `ainize.model(<MODEL_NAME>)`.
### Using Service
You can use a service using `ainize.service(<SERVICE_NAME>)`.
```typescript
const model = await ainize.model(<MODEL_NAME>);
const service = await ainize.service(<SERVICE_NAME>);
```

You should deposit AIN to credit before using model.
You should deposit AIN to credit before using service.
```typescript
await model.deposit(<AMOUNT>);
const balance = await model.getCreditBalance();
await service.chargeCredit(<AMOUNT>);
const balance = await service.getCreditBalance();
```

If you have enough credit, you can use the model.
If you have enough credit, you can use the service.
```typescript
const result = await model.use(<REQUEST_DATA>);
const result = await service.use(<REQUEST_DATA>);
```

0 comments on commit f53026b

Please sign in to comment.