ai-microcore

# Minimalistic Foundation for AI Applications

MIT License

Downloads
11.2K
Stars
15
ai-microcore - v3.10.2 Latest Release

Published by Nayjest 3 months ago

Changes:

  • Logging fixes/improvements
  • Autofixing dialogue structure for Anthropic API

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.10.1...v3.10.2

ai-microcore - v3.10.1

Published by Nayjest 3 months ago

default logging refactoring / improvements:

  • possibility to configure logging output method / request+response formatters separately
  • fix color reset bug

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.10.0...v3.10.1

ai-microcore - v3.10.0

Published by Nayjest 3 months ago

What's Changed

  • New feature Tiktoken usage for estimating number of tokens in prompt / response, fitting semantic search results to target token number
    Examples:

    // limit semantic search results
    mc.texts.search("test_collection", "query", n_results=20).fit_to_token_size(max_tokens=5, min_documents=3)
    // extended string now have .to_tokens() and .num_tokens() methods:
    prompt= mc.tpl('my_template.j2')
    tokens = prompt.to_tokens(for_model="gpt-4") 
    prompt.num_tokens()
    mc.llm(prompt).num_tokens()
    

    For usage with any regular strings, see microcore.tokenizing

  • ui improvements:

    • ui.ask_yn() now have "default" argument and also handles KeyboardInterrupt
    • new function: ui.warninig()
  • Other minor fixes

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.9.1...v3.10.0

ai-microcore - v3.9.1

Published by Nayjest 5 months ago

bugfix: avoid recursion when json.JSONEncoder fallbacks to default & produce exception, provide original exception

ai-microcore - v3.9.0

Published by Nayjest 6 months ago

Changelog

  • Config.display(): Improved masking of private keys.
  • Config.display(): Resolved issue #18 where the google_vertex_response_validation field appeared in config.describe for non-Google APIs.
  • Config.display(): Fixed an issue where fields loaded into ENV that differ from defaults were not displayed.
  • get_bool_from_env(): Corrected to ensure default values are not converted to boolean.
  • Added a metrics context manager.
  • Python code execution: Added max_execution_time to the Timeout error text in python.execute() to display maximum execution time.
  • Updated and extended requirements, including chroma_db and anthropic.
  • OpenAI API: Enhanced error handling.
  • Transformers: Added support for OpenAI-style parameters (n, seed, stop).
  • Fix #22: Corrected an issue where responses from the Anthropic API had a "content" property that overrides the default one provided by microcore in the LLMResponse class.
  • configure(): Updated to accept a configuration file name as its sole argument.
  • Enhanced capability to configure properties with list or dict types from JSON-serialized values in environment variables or configuration files.
  • Enabled the configuration of callables as strings using the format <module_name>.<func_name>.
  • The following configuration fields can now be loaded from environment variables or configuration files: CHAT_MODE, GOOGLE_VERTEX_GCLOUD_AUTH, GOOGLE_GEMINI_SAFETY_SETTINGS, LLM_DEFAULT_ARGS, INFERENCE_FUNC, STORAGE_DEFAULT_FILE_EXT, EMBEDDING_DB_FOLDER, MAX_CONCURRENT_TASKS.
  • Additional documentation comments have been added.
  • Additional tests have been added.

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.8.0...v3.9.0

ai-microcore - v3.8.0

Published by Nayjest 6 months ago

  • Python code execution utils added

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.7.0...v3.8.0

ai-microcore - v3.7.0

Published by Nayjest 6 months ago

ai-microcore - v3.6.1

Published by Nayjest 6 months ago

ai-microcore - v3.6.0

Published by Nayjest 6 months ago

v3.6.0: PromptWrapper now additionally stores its arguments as properties

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.5.0...v3.6.0

ai-microcore - v3.5.0

Published by Nayjest 6 months ago

Parallel inference functionality added

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.4.0...v3.5.0

ai-microcore - v3.4.0

Published by Nayjest 6 months ago

Changes include transformers adapter improvements, new config options: & utils:

  • support inference via transformers.pipeline
  • init_params.always_clear_mem: gc.collect() & torch.cuda.empty_cache() before inference
  • init_params.gradient_checkpointing: bool
  • init_params.pipeline_task: str
  • init_params.use_pipeline: bool
  • possibility to configure transformers inference function by name (str)
  • utils: ui.black() added
  • bugfix: prevent config validation errors for ApiType.NONE
  • config validation tests, Qwen1.5-1.8B-Chat added to local transformers tests

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.3.1...v3.4.0

ai-microcore - v3.3.1

Published by Nayjest 6 months ago

  • utils.dedent() implemented, automatically removing indent from template strings in mc.prompt()
  • fmt(): alias to prompt()
  • fmt, prompt, Config added mo module exports

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.2.1...v3.3.1

ai-microcore - v3.2.1

Published by Nayjest 6 months ago

Changes

  • ApiType.NONE added for handling setups without language model

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.2.0...v3.2.1

ai-microcore - v3.2.0

Published by Nayjest 6 months ago

Changes:

  • New functionality: utils.extract_number() // LLMResponse.parse_number(): parsing numbers from llm responses
  • LLMResponse.gen_duration: float attribute added (inference duration in seconds)
  • Configuring improvements: Automatically convert configuration keys to uppercase
  • Configuring improvements: Add LLM_ prefix to keys if necessary
  • Configuring improvements: Allow to configure from Config instance or dictionary
  • Fixed: various occurrences of inoptimal arguments merging (impossibility to override defaults)
  • Local models functionality reworked

Full Changelog: https://github.com/Nayjest/ai-microcore/compare/v3.1.0...v3.2.0

ai-microcore -

Published by Nayjest 6 months ago

Changelog

  • Fixing invalid JSON generated by language models
ai-microcore - v3.0.2

Published by Nayjest 6 months ago

ai-microcore - v3.0.1

Published by Nayjest 6 months ago

ai-microcore - v3.0.0

Published by Nayjest 7 months ago

Changelog

  • Support of local language models through custom inference function
  • Support of local transformers models
  • INIT_PARAMS: dict config parameter introduced to customize local models / API clients
  • CHAT_MODE: bool config parameter introduced to force switch to text-completion/chat mode
  • Config instance now may be casted to dict (convenient to reconfigure / export)
  • More tests added
  • API tests fixed
  • get_vram_usage(), show_vram_usage() & is_google_colab() utility functions implemented
  • (llm response str).as_message + (prompt | llm response str).as_user, .as_system, .as_assistant, .as_model properties added (utils.ConvertableToMessage class)
ai-microcore - v2.1.1

Published by Nayjest 7 months ago

Changelog

Fix #14 : Unwanted behaviour: previous configuration remains active when calling configure(...) with invalid settings

ai-microcore - v2.1.0

Published by Nayjest 7 months ago

microcore v2.1.0

  • is_notebook(), is_caggle(), coloring utility functions added
  • bugfix colorama in Jupyter notebooks
  • more informal exceptions
  • code style fixes